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

Add OTLP LogExporter example #2481

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

cijothomas
Copy link
Member

just a basic example to get up and running with OTLP Logs.

@cijothomas cijothomas requested a review from a team October 12, 2021 22:17
* launch the OpenTelemetry Collector with an OTLP receiver, by running:
*
* - On Unix based systems use:
* docker run --rm -it -p 4317:4317 -v $(pwd):/cfg otel/opentelemetry-collector:0.33.0 --config=/cfg/otlp-collector-example/config.yaml
Copy link
Member

Choose a reason for hiding this comment

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

nit: Latest version is 0.36.0

Another thought is if we don't want to keep updating this we could use :latest ... but usually explicit tag versions are ideal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Want to do that when we pick new proto files, as I wasn't sure if they are all compatible with each other. (I hope they are, just did not have time to validate it, so another PR for that)

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #2481 (9e31bb1) into main (ed814d1) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2481      +/-   ##
==========================================
- Coverage   79.84%   79.80%   -0.04%     
==========================================
  Files         254      254              
  Lines        8393     8393              
==========================================
- Hits         6701     6698       -3     
- Misses       1692     1695       +3     
Impacted Files Coverage Δ
...nTelemetry/Internal/OpenTelemetrySdkEventSource.cs 71.02% <0.00%> (-3.74%) ⬇️
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 97.63% <0.00%> (+0.78%) ⬆️

@cijothomas cijothomas merged commit 6664781 into open-telemetry:main Oct 12, 2021
@cijothomas cijothomas deleted the cijothomas/logexample1 branch October 12, 2021 22:50
@p10tyr
Copy link

p10tyr commented May 4, 2022

Hi
I am just trying to see if I can get logs into Elastic Stack. It seems that since ES version 8 it is supported with the unstable data model for now. (I am on ES 8.1)

I am looking at this example and it seems to use a local collector but I do not see where the URI is being configured? Is the default just localhost:4317 as per the docker instructions?

So for my logging configuration I am using. I don't think I need to explicitly specify GRPC (but that is the only protocol Elastics supports for now) neither the simple exporter?

Sadly I do not see anything show up in Elastic streams and by the looks of #2482 there should be some basic data coming through

Using OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs 1.0.0-rc9.2 (lowest to match)
To match stable OpenTelemetry 1.2.0

Unless I need to bump up to Otel 1.3.0 and logs-rc9.3?

 .AddLogging(configure => configure.AddOpenTelemetry(options =>
                {
                    options.IncludeScopes = true;

                    options.AddOtlpExporter(otlpExporter =>
                    {
                        otlpExporter.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;
                        otlpExporter.ExportProcessorType = ExportProcessorType.Simple;
                        otlpExporter.Endpoint = new System.Uri("https://xyz.apm.aws.cloud.es.io");
                        otlpExporter.Headers = "Authorization=Bearer supersecret";
                    });
                }));

@cijothomas
Copy link
Member Author

@ppumkin Please open a new issue for this. Thanks.

@p10tyr
Copy link

p10tyr commented May 4, 2022

Thanks Cijo I followed the links to create a discussion.

Just in case anybody wants to follow...
#3249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants