com.signalfx.metrics.connection.HttpDataPointProtobufReceiverConnectionV2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signalfx-java Show documentation
Show all versions of signalfx-java Show documentation
Bare minimum core library needed to sending metrics to SignalFx from Java clients
The newest version!
package com.signalfx.metrics.connection;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.signalfx.shaded.apache.http.HttpEntity;
import com.signalfx.shaded.apache.http.conn.HttpClientConnectionManager;
import com.signalfx.shaded.apache.http.entity.ByteArrayEntity;
import com.signalfx.endpoint.SignalFxReceiverEndpoint;
import com.signalfx.metrics.SignalFxMetricsException;
import com.signalfx.metrics.protobuf.SignalFxProtocolBuffers;
public class HttpDataPointProtobufReceiverConnectionV2
extends AbstractHttpDataPointProtobufReceiverConnection {
public HttpDataPointProtobufReceiverConnectionV2(
SignalFxReceiverEndpoint endpoint, int timeoutMs,
HttpClientConnectionManager httpClientConnectionManager) {
super(endpoint, timeoutMs, httpClientConnectionManager);
}
public HttpDataPointProtobufReceiverConnectionV2(
SignalFxReceiverEndpoint endpoint, int timeoutMs, int maxRetries,
HttpClientConnectionManager httpClientConnectionManager) {
super(endpoint, timeoutMs, maxRetries, httpClientConnectionManager);
}
public HttpDataPointProtobufReceiverConnectionV2(
SignalFxReceiverEndpoint endpoint, int timeoutMs, int maxRetries,
HttpClientConnectionManager httpClientConnectionManager, List> nonRetryableExceptions) {
super(endpoint, timeoutMs, maxRetries, httpClientConnectionManager, nonRetryableExceptions);
}
@Override
protected String getEndpointForAddDatapoints() {
return "/v2/datapoint";
}
@Override
protected HttpEntity getEntityForVersion(List dataPoints) {
byte[] bodyBytes = SignalFxProtocolBuffers.DataPointUploadMessage.newBuilder()
.addAllDatapoints(dataPoints).build().toByteArray();
return new ByteArrayEntity(bodyBytes, PROTO_TYPE);
}
@Override
public Map registerMetrics(String auth,
Map metricTypes)
throws SignalFxMetricsException {
Map res = new HashMap();
for (Map.Entry i : metricTypes.entrySet()) {
res.put(i.getKey(), true);
}
return res;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy