[Monitor] Generate exporter with TypeSpec#44442
Open
pvaneck wants to merge 12 commits intoAzure:mainfrom
Open
Conversation
cd26a71 to
b658113
Compare
Member
|
@pvaneck I can create a separate PR that runs the black format checks on the existing exporter code. I will share it once it is ready for review. |
Member
Author
|
@rads-1996 Thanks, but I believe it was already formatted with #44462. I just need to rebase off of main. |
8ee495f to
20fc16d
Compare
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
20fc16d to
bc3ca46
Compare
rads-1996
reviewed
Jan 22, 2026
| result = exporter._transmit(self._envelopes_to_export) | ||
|
|
||
| track_dropped_mock.assert_called_once() | ||
| track_dropped_mock.assert_any_call(self._envelopes_to_export, 402) |
Member
There was a problem hiding this comment.
why are these function calls changed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generation from TypeSpec from the branch in this PR: Azure/azure-rest-api-specs#38795
Noteable changes
timefield inTelemetryItemseems to have always been typed asdatetime.datetime, but was being set as a ISO8601 date string. I have adjusted the tests and the_create_telemetry_itemmethod to set thetimeto adatetimeobject and have adjusted the tests accordingly. The datetime objects will be serialized to the ISO8601 formatted strings (e.g.2025-12-15T13:45:30.0000000Zwhen sent in a request anyway, so this should be fine.versionproperty in theDomainmodel has a default of 2, however, the generated code does not include this as a default. The code was updated to explicitly set theversionargument when constructing subclasses ofDomain.Notes:
tsp-clientwhere the Exporter project will be emitted intoazure/monitor/opentelemetry/exporter/_generated. LiveMetrics will be emitted toazure/monitor/opentelemetry/exporter/_quickpulse/_generatedin the future.tests/trace/test_trace.py::TestAzureTraceExporter::test_get_otel_resource_envelope, was failing after the regeneration. It is comparing OTelResourceattributes withMetricsData.properties, but thepropertiesfield is type and serialized asDict[str, str]. Thus, all values end up as strings when checking the values ofproperties.Asks for team
datetimeobjects instead of strings when creatingTelemetryItemsis acceptable.MetricsDatais acceptable.