Add support for OTLP Log exporter - #1943
Merged
Merged
Conversation
Co-authored-by: alrex <alrex.boten@gmail.com>
…lemetry-python into logging-otlp-handler
Co-authored-by: Leighton Chen <lechen@microsoft.com>
…emetry-python into logs-processor-impl
This reverts commit 0367af1.
…metry-python into logs-otlp-exporter
srikanthccv
marked this pull request as ready for review
July 22, 2021 09:14
srikanthccv
requested review from
a team,
codeboten and
owais
and removed request for
a team
July 22, 2021 09:14
codeboten
approved these changes
Jul 26, 2021
codeboten
left a comment
Contributor
There was a problem hiding this comment.
Code looks good, just one question.
| timeout: Optional[int] = None, | ||
| compression: Optional[Compression] = None, | ||
| ): | ||
| super().__init__( |
Contributor
There was a problem hiding this comment.
is additional code needed here to handle OTEL_EXPORTER_OTLP_LOGS_* env variables? Something like this:
Member
Author
There was a problem hiding this comment.
I initially added this but since they are not defined anywhere (not even experimental/reserved) I reverted the env changes.
ocelotl
approved these changes
Jul 27, 2021
| if log_data.log_record.attributes: | ||
| self._collector_log_kwargs["attributes"] = [] | ||
| for key, value in log_data.log_record.attributes.items(): | ||
| try: |
Contributor
There was a problem hiding this comment.
Why is this try necessary?
Member
Author
There was a problem hiding this comment.
This was needed because _translate_key_values raises an exception when it doesn't find a way to translate value.
lzchen
pushed a commit
to lzchen/opentelemetry-python
that referenced
this pull request
Oct 15, 2021
codeboten
pushed a commit
that referenced
this pull request
Oct 29, 2021
owais
added a commit
that referenced
this pull request
Nov 3, 2021
* Add initial overall structure and classes for logs sdk (#1894) * Add global LogEmitterProvider and convenience function get_log_emitter (#1901) * Add OTLPHandler for standard library logging module (#1903) * Add LogProcessors implementation (#1916) * Fix typos in test_handler.py (#1953) * Add support for OTLP Log exporter (#1943) * Add support for user defined attributes in OTLPHandler (#1952) * use timeout in force_flush (#2118) * use timeout in force_flush * fix lint * Update opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com> * fix lint Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com> * add a ConsoleExporter for logging (#2099) Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com> * Update SDK docs and Add example with OTEL collector logging (debug) exporter (#2050) * Fix exception in severity number transformation (#2208) * Fix exception with warning message transformation * Fix lint * Fix lint * fstring * Demonstrate how to set the Resource for LogEmitterProvider (#2209) * Demonstrate how to set the Resource for LogEmitterProvider Added a Resource to the logs example to make it more complete. Previously it was using the built-in Resource. Now it adds the service.name and service.instance.id attributes. The resulting emitted log records look like this: ``` Resource labels: -> telemetry.sdk.language: STRING(python) -> telemetry.sdk.name: STRING(opentelemetry) -> telemetry.sdk.version: STRING(1.5.0) -> service.name: STRING(shoppingcart) -> service.instance.id: STRING(instance-12) InstrumentationLibraryLogs #0 InstrumentationLibrary __main__ 0.1 LogRecord #0 Timestamp: 2021-10-14 18:33:43.425820928 +0000 UTC Severity: ERROR ShortName: Body: Hyderabad, we have a major problem. Trace ID: ce1577e4a703f42d569e72593ad71888 Span ID: f8908ac4258ceff6 Flags: 1 ``` * Fix linting * Use batch processor in example (#2225) * move logs to _logs (#2240) * move logs to _logs * fix lint * move log_exporter to _log_exporter as it's still experimental (#2252) Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com> Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Co-authored-by: Leighton Chen <lechen@microsoft.com> Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com> Co-authored-by: Owais Lone <owais@users.noreply.github.com>
codeboten
pushed a commit
to codeboten/opentelemetry-python
that referenced
this pull request
Nov 3, 2021
lzchen
pushed a commit
that referenced
this pull request
Nov 4, 2021
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.
Description
Part-5 for #1890