We hold regular community meetings, see the calendar here: https://opencensus.io/community/
lzchen on v0.10.x
lzchen on master
Add kwargs to derived gauge (#1… (compare)
lzchen on master
Use logging handler close inste… (compare)
public void record(MetricsType metrics, String appId, Map<MetricsTagKey, String> tags) {
Assert.notNull(metrics, "You have to pick a metrics type");
Assert.notEmpty(tags, "Tags can't be null");
logger.info("== > Recording metrics '{}' for app ID '{}' with tag values {} ", metrics.toString(), appId, tags.toString());
TagContextBuilder tcb = tagger.emptyBuilder();
// add appId
tcb.putLocal(TagKey.create(MetricsTagKey.APP_ID.key), TagValue.create(appId));
// add all other tags
tags.forEach((k, v) -> {
tcb.putLocal(TagKey.create(k.key), TagValue.create(v));
});
TagContext ctx = tcb.build();
if (metrics.equals(MetricsType.EMAILS_SENT_COUNT)) {
try (Scope sc = tagger.withTagContext(ctx)) {
STATS_RECORDER.newMeasureMap().put(emailsSentCount, 1L).record();
}
} else {
// log metrics not supported
}
}
this is how the measure is initialized: emailsSentCount = MeasureLong.create(monitoringConfig.getProperty(EMAILS_SENT_NAME),
monitoringConfig.getProperty(EMAILS_SENT_DESCRIPTION),
"1");
List<TagKey> emailsSentKeys = new ArrayList<>();
for (MetricsTagKey v: MetricsTagKey.values()) {
emailsSentKeys.add(TagKey.create(v.key));
}
View emailsSentCountView = View.create(Name.create(monitoringConfig.getProperty(EMAILS_SENT_NAME)),
monitoringConfig.getProperty(EMAILS_SENT_DESCRIPTION),
emailsSentCount,
Count.create(),
emailsSentKeys);
Hello, I need to propagate HTTP headers (zipkin) from inbound to outbound HTTP requests. I'm using nestjs which use axios as http module. Did the opencensus/propagation-b3 tracer does it? thanks in advance.
Yes, it should work for you. here is link for sample code : https://github.com/census-instrumentation/opencensus-node/tree/master/packages/opencensus-propagation-b3#usage
private static final MeasureLong M_CACHE_ACCESSES = MeasureLong.create("cache_accesses", "The number times the cache was accessed", "1");
private static void recordTaggedStat(TagKey key, String value, MeasureLong m, long value) {
TagContext tctx = tagger.emptyBuilder().put(key, TagValue.create(value)).build();
try (Scope ss = tagger.withTagContext(tctx)) {
statsRecorder.newMeasureMap().put(m, value).record();
}
}
Calls to record metrics for the three access types:
recordTaggedStat(TAGKEY_CACHE_MODE, "GET", M_CACHE_ACCESSES, long_value);
recordTaggedStat(TAGKEY_CACHE_MODE, "SET", M_CACHE_ACCESSES, long_value);
recordTaggedStat(TAGKEY_CACHE_MODE, "DEL", M_CACHE_ACCESSES, long_value);
I'm getting a bad decrypt when I try to set the env variable using /tests/system/set_credentials.sh
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
bad decrypt
140663209464256:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:537:
Doest anyone know why this happens when running the test?
requests
and the extension, but i’m not getting any requests info (http method, status code, etc.) in Google's Cloud Trace
. the span does appear though. has anyone else run into this issue? any extra configuration needed to be added?
'opencensus>=0.7.7',
'opencensus-ext-requests>=0.7.3',
'opencensus-ext-stackdriver>=0.7.2',
'requests==2.22.0’,
def initialize_tracer():
exporter = StackdriverExporter(project_id=‘<PROJECT_ID>’, transport=AsyncTransport)
return Tracer(exporter=exporter, sampler=AlwaysOnSampler())
tracer = initialize_tracer()
config_integration.trace_integrations(['requests'], tracer=tracer)
with tracer.span(name=’span_name'):
response = requests.get(url='https://www.wikipedia.org/wiki/Rabbit’)
# Span appears but without any requests information