public class AtlasMetricObserver
extends java.lang.Object
implements com.netflix.servo.publish.MetricObserver
| Modifier and Type | Field and Description |
|---|---|
protected ServoAtlasConfig |
config |
protected HttpHelper |
httpHelper |
protected long |
sendTimeoutMs |
protected long |
stepMs |
| Constructor and Description |
|---|
AtlasMetricObserver(ServoAtlasConfig config,
com.netflix.servo.tag.TagList commonTags)
Create an observer that can send metrics to atlas with a given
config and list of common tags.
|
AtlasMetricObserver(ServoAtlasConfig config,
com.netflix.servo.tag.TagList commonTags,
int pollerIdx)
Create an observer that can send metrics to atlas with a given config, list of common tags,
and poller index.
|
AtlasMetricObserver(ServoAtlasConfig config,
com.netflix.servo.tag.TagList commonTags,
int pollerIdx,
HttpHelper httpHelper)
Create an atlas observer.
|
| Modifier and Type | Method and Description |
|---|---|
protected static com.netflix.servo.Metric |
asCounter(com.netflix.servo.Metric m) |
protected static com.netflix.servo.Metric |
asGauge(com.netflix.servo.Metric m) |
protected void |
dumpPayload(java.io.File out,
JsonPayload payload) |
protected java.util.List<com.netflix.servo.Metric> |
filter(java.util.List<com.netflix.servo.Metric> metrics)
Return metrics to be sent to the main atlas deployment.
|
protected com.netflix.servo.tag.TagList |
getCommonTags()
Get the list of common tags that will be added to all metrics sent by this Observer.
|
java.lang.String |
getName() |
protected int |
getNumberOfCopies() |
protected java.lang.String |
getPayloadDirectory() |
protected rx.Observable<java.lang.Integer> |
getSenderObservable(com.netflix.servo.tag.TagList tags,
com.netflix.servo.Metric[] batch) |
protected static java.util.List<com.netflix.servo.Metric> |
identifyDsTypes(java.util.List<com.netflix.servo.Metric> metrics) |
protected static boolean |
isCounter(com.netflix.servo.Metric m) |
protected static boolean |
isGauge(com.netflix.servo.Metric m) |
protected static boolean |
isRate(com.netflix.servo.Metric m) |
protected static com.netflix.servo.monitor.Counter |
newErrCounter(java.lang.String name,
java.lang.String err) |
void |
push(java.util.List<com.netflix.servo.Metric> rawMetrics)
Immediately send metrics to the backend.
|
protected void |
sendNow(com.netflix.servo.publish.atlas.AtlasMetricObserver.UpdateTasks updateTasks) |
protected boolean |
shouldDumpPayload() |
protected boolean |
shouldIncludeMetric(com.netflix.servo.Metric metric) |
void |
stop()
Stop attempting to send metrics to atlas.
|
protected java.util.List<com.netflix.servo.Metric> |
transformMetrics(java.util.List<com.netflix.servo.Metric> metrics) |
void |
update(java.util.List<com.netflix.servo.Metric> rawMetrics) |
protected rx.functions.Func1<iep.io.reactivex.netty.protocol.http.client.HttpClientResponse<io.netty.buffer.ByteBuf>,java.lang.Integer> |
withBookkeeping(int batchSize)
Utility function to map an Observable<ByteBuf> to an Observable<Integer> while also
updating our counters for metrics sent and errors.
|
protected final HttpHelper httpHelper
protected final ServoAtlasConfig config
protected final long sendTimeoutMs
protected final long stepMs
public AtlasMetricObserver(ServoAtlasConfig config, com.netflix.servo.tag.TagList commonTags)
public AtlasMetricObserver(ServoAtlasConfig config, com.netflix.servo.tag.TagList commonTags, int pollerIdx)
public AtlasMetricObserver(ServoAtlasConfig config, com.netflix.servo.tag.TagList commonTags, int pollerIdx, HttpHelper httpHelper)
protected boolean shouldDumpPayload()
protected java.lang.String getPayloadDirectory()
public void stop()
protected static com.netflix.servo.monitor.Counter newErrCounter(java.lang.String name,
java.lang.String err)
protected static com.netflix.servo.Metric asGauge(com.netflix.servo.Metric m)
protected static com.netflix.servo.Metric asCounter(com.netflix.servo.Metric m)
protected static boolean isCounter(com.netflix.servo.Metric m)
protected static boolean isGauge(com.netflix.servo.Metric m)
protected static boolean isRate(com.netflix.servo.Metric m)
protected static java.util.List<com.netflix.servo.Metric> identifyDsTypes(java.util.List<com.netflix.servo.Metric> metrics)
public java.lang.String getName()
getName in interface com.netflix.servo.publish.MetricObserverpublic void push(java.util.List<com.netflix.servo.Metric> rawMetrics)
rawMetrics - Metrics to be sent. Names and tags will be sanitized.protected void sendNow(com.netflix.servo.publish.atlas.AtlasMetricObserver.UpdateTasks updateTasks)
protected boolean shouldIncludeMetric(com.netflix.servo.Metric metric)
protected java.util.List<com.netflix.servo.Metric> filter(java.util.List<com.netflix.servo.Metric> metrics)
protected java.util.List<com.netflix.servo.Metric> transformMetrics(java.util.List<com.netflix.servo.Metric> metrics)
public void update(java.util.List<com.netflix.servo.Metric> rawMetrics)
update in interface com.netflix.servo.publish.MetricObserverprotected int getNumberOfCopies()
protected void dumpPayload(java.io.File out,
JsonPayload payload)
throws java.io.IOException
java.io.IOExceptionprotected rx.Observable<java.lang.Integer> getSenderObservable(com.netflix.servo.tag.TagList tags,
com.netflix.servo.Metric[] batch)
protected com.netflix.servo.tag.TagList getCommonTags()
protected rx.functions.Func1<iep.io.reactivex.netty.protocol.http.client.HttpClientResponse<io.netty.buffer.ByteBuf>,java.lang.Integer> withBookkeeping(int batchSize)