You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we've only got the ocagent trace exporter. It would be nice to have once for stats too so that we can start to use the OpenCensus Agent.
I see #454 open but that issue will involve doing a bunch of double work since it is almost rewriting those exporters. With the ocagent exporter converts stats aka view_data to OpenCensus Proto Metrics, folks can then switch over to just using the agent.
I am coming here as I am currently writing the guide for the new OpenCensus Redis-Py wrapper https://pypi.org/project/ocredis/ and it works great with the Trace exporter i.e.
#!/usr/bin/env pythonimportocredisfromopencensus.trace.tracerimportTracerfromopencensus.trace.exporters.ocagent.trace_exporterimportTraceExporterfromopencensus.trace.samplersimportalways_onfromopencensus.common.transportsimportasync_defcreate_opencensus_exporters_and_tracer():
# Create the ocagent-exporter that'll upload our traces# to the OpenCensus Agent.octe=TraceExporter(service_name='pysearch', transport=async_.AsyncTransport)
tracer_init_args=dict(exporter=octe,
# Always sampling for demo purposes.sampler=always_on.AlwaysOnSampler())
returntracer_init_argsdefmain():
r=ocredis.OcRedis(host='localhost', port=6379, db=10)
tracer_init_args=create_opencensus_exporters_and_tracer()
whileTrue:
query=raw_input('$ ')
response=do_search(r, query, **tracer_init_args)
print('> '+response+'\n')
defdo_search(client, query, **tracer_init_kwargs):
tracer=Tracer(**tracer_init_kwargs)
withtracer.span('Search') asspan:
span.add_annotation('Searching', query=query)
# Check Redis if we've already memoized the response.response=client.get(query)
ifresponseisnotNone: # Cache hitspan.add_annotation('Cache hit', store='redis', client='redis-py')
print('Cache hit! Now deleting it to make for a cache miss later')
# Clear the response so that the next search will return a cache-miss.client.delete(query)
else: # Cache missspan.add_annotation('Cache miss', store='redis', client='redis-py')
print('Cache miss! Now processing and memoizing it to make for a cache hit later')
# Now process the result and memoize it.response=query.upper()
client.set(query, response)
span.finish()
returnresponseif__name__=='__main__':
main()
but after writing that, I came over to use the ocagent-stats exporter but didn't find any.
The text was updated successfully, but these errors were encountered:
Currently we've only got the ocagent trace exporter. It would be nice to have once for stats too so that we can start to use the OpenCensus Agent.
I see #454 open but that issue will involve doing a bunch of double work since it is almost rewriting those exporters. With the ocagent exporter converts stats aka view_data to OpenCensus Proto Metrics, folks can then switch over to just using the agent.
I am coming here as I am currently writing the guide for the new OpenCensus Redis-Py wrapper https://pypi.org/project/ocredis/ and it works great with the Trace exporter i.e.
but after writing that, I came over to use the ocagent-stats exporter but didn't find any.
The text was updated successfully, but these errors were encountered: