azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Implement Customer Facing Statsbeat

Open rads-1996 opened this issue 5 months ago • 1 comments

Description

Implement customer facing statsbeat as a preview feature.

Packages impacted by this PR

@azure/monitor-opentelemetry-exporter

All SDK Contribution checklist:

  • [x] The pull request does not introduce [breaking changes]
  • [x] CHANGELOG is updated for new features, bug fixes or other significant changes.
  • [x] I have read the contribution guidelines.

General Guidelines and Best Practices

  • [x] Title of the pull request is clear and informative.
  • [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • [ ] Pull request includes test coverage for the included changes.

rads-1996 avatar Jun 19 '25 19:06 rads-1996

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-monitor-opentelemetry-exporter

github-actions[bot] avatar Jun 19 '25 20:06 github-actions[bot]

This PR is quite big a complex. I suggest implementing this feature in different parts to ensure easier manual testing of each part.

lzchen avatar Jun 23 '25 15:06 lzchen

@lzchen the new changes are only checking the if successful items are correctly being captured in AppInsights. Below is a screenshot of the same -

successful_items

Additionally, I have verified that _base.py sends envelopes to the put method in storage.py by taking a list of telemetry envelopes resend_envelopes and converts each envelope to a dictionary format using as_dict(). Please find the screenshot for this below -

image

TODO: Once these changes are approved, will add the logic for dropped and retried items and also for recently added customer statsbeat codes in the specification.

rads-1996 avatar Jun 27 '25 18:06 rads-1996

@lzchen I discovered that the envelope names and the base_type to determine the type of telemetry are a bit different. The envelope names are usually of the format - "Microsoft.ApplicationInsights.RemoteDependency", whereas the base_type is "RemoteDependencyData", that is with the suffix "data". I saw that although the envelope names are added to _constants.py, the base_type is hardcoded. I found this code from _exporter.py -

image

In the follow up PR, should I add the constants for base_type and use it in both customer statsbeat and the regular statsbeat. For now I have added the _REMOTE_DEPENDENCY_ENVELOPE_DATA in _constants.py.

rads-1996 avatar Jul 02 '25 18:07 rads-1996