Skip to content

Commit

Permalink
add NoOpSender (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oseenix authored May 7, 2022
1 parent da2b918 commit fa23242
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
13 changes: 11 additions & 2 deletions build/src/main/resources/agent.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ plugin.observability.global.metric.enabled=true
plugin.observability.global.metric.interval=30
plugin.observability.global.metric.topic=application-metrics
plugin.observability.global.metric.url=/application-metrics

##
# if different with reporter.outputServer.appendType,
# following options can be used in user config file to override
# the default or global one
#
## when it's scrape by prometheus, noop can be used
# plugin.observability.global.metric.appendType=noop
## for debug, console can be used
# plugin.observability.global.metric.appendType=console
## output by http
#plugin.observability.global.metric.appendType=http
# plugin.observability.global.metric.appendType=http
#
# add service name to header enabled by name for easemesh
plugin.integrability.global.addServiceNameHead.enabled=true
# redirect the middleware address when env has address, see: com.megaease.easeagent.plugin.api.middleware.RedirectProcessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ private ReportConfigConst() {}
public static final String CONSOLE_SENDER_NAME = "console";
public static final String ZIPKIN_SENDER_NAME = "http";

public static final String NOOP_SENDER_NAME = "noop";

public static final String SPAN_JSON_ENCODER_NAME = "SpanJsonEncoder";
public static final String METRIC_JSON_ENCODER_NAME = "MetricJsonEncoder";
public static final String LOG_DATA_JSON_ENCODER_NAME = "LogDataJsonEncoder";
Expand Down
Binary file modified doc/images/grafana-tracing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package com.megaease.easeagent.report.sender;

import com.google.auto.service.AutoService;
import com.megaease.easeagent.config.report.ReportConfigConst;
import com.megaease.easeagent.plugin.api.config.Config;
import com.megaease.easeagent.plugin.report.Call;
import com.megaease.easeagent.plugin.report.EncodedData;
Expand All @@ -26,12 +28,13 @@
import java.io.IOException;
import java.util.Map;

@AutoService(Sender.class)
public class NoOpSender implements Sender {
public static final NoOpSender INSTANCE = new NoOpSender();

@Override
public String name() {
return "noop";
return ReportConfigConst.NOOP_SENDER_NAME;
}

@Override
Expand All @@ -41,12 +44,12 @@ public void init(Config config, String prefix) {

@Override
public Call<Void> send(EncodedData encodedData) {
return new NoOpCall<>();
return NoOpCall.getInstance(NoOpSender.class);
}

@Override
public boolean isAvailable() {
return false;
return true;
}

@Override
Expand Down

0 comments on commit fa23242

Please sign in to comment.