Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TelemetryProcessors for Azure exporters #851

Merged
merged 14 commits into from
Jan 29, 2020

Conversation

lzchen
Copy link
Contributor

@lzchen lzchen commented Jan 27, 2020

Implement TelemetryProcessors for Azure Exporters.

TelemetryProcessors allow users to define a callback function to modify the envelopes before they are sent to the Azure Monitor backend. They can also be used to omit envelopes from being exported. Refer to the README on how users can do this and what the schema for the payloads look like.

See this article on how other SDKs are doing this in other languages for Azure Monitor.

@lzchen lzchen changed the title Implement TelemetryInitializer for Azure exporters Implement TelemetryProcessors for Azure exporters Jan 27, 2020
Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd like to see a test of callbacks that actually modify the envelope.

The example prose changes look good, but you may want to rearrange the text so it doesn't explain exporter callbacks three times.

contrib/opencensus-ext-azure/README.rst Outdated Show resolved Hide resolved
@@ -179,6 +203,63 @@ Below is a list of standard metrics that are currently available:
- Process CPU Usage (percentage)
- Process Private Bytes (bytes)

You can pass a callback function to the exporter to process telemetry before it is exported. Your callback function can return `False` if you do not want this envelope exported. Your callback function must
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want this text duplicated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine having the text duplicated, we have duplicate documentation for creating an Azure Monitor resource and how to instrument with the instrumentation_key for each section. Usually users come to this page looking for a specific section (either trace, metrics or logs) so this shouldn't be a eyesore.

contrib/opencensus-ext-azure/README.rst Show resolved Hide resolved
),
sampler=ProbabilitySampler(1.0),
)
with tracer.span(name='parent'):
response = requests.get(url='https://www.wikipedia.org/wiki/Rabbit')

You can pass a callback function to the exporter to process telemetry before it is exported. Your callback function can return `False` if you do not want this envelope exported. Your callback function must
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again?

contrib/opencensus-ext-azure/tests/test_processor.py Outdated Show resolved Hide resolved
contrib/opencensus-ext-azure/tests/test_processor.py Outdated Show resolved Hide resolved
@lzchen lzchen merged commit 4f4f020 into census-instrumentation:master Jan 29, 2020
@lzchen lzchen deleted the initializer branch January 29, 2020 00:42
@lzchen lzchen mentioned this pull request Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants