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

Verify and update OTLP trace exporter documentation #2053

Merged
merged 32 commits into from Sep 2, 2021

Conversation

Submarinee
Copy link
Contributor

@Submarinee Submarinee commented Jul 3, 2021

Partially resolved issue #2016 .
I referred to changes related to OTLP trace exporter in #1827,#1832,#1922, #1963,#1985,#1991, #2013 and created a README about the changes.
BecauseI am a freshman in opentelemetry-go, maybe my PR is not good enough.
If you think I can improve in any aspect, please bring it up.
I am very willing to listen to your suggestions.
Thank u~

I will continue to inventory the documentation for OTLP metric exporter.

  • Inventory the documentation for OTLP metric exporter.

@Submarinee Submarinee changed the title Verify and update OTLP exporter documentation Verify and update OTLP trace exporter documentation Jul 4, 2021
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
Submarinee and others added 3 commits July 7, 2021 10:12
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
@MrAlias MrAlias added this to In progress in OpenTelemetry Go 1.0.0 via automation Jul 22, 2021
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
@MrAlias MrAlias added documentation Provides helpful information pkg:exporter:otlp Related to the OTLP exporter package labels Jul 22, 2021
@MrAlias MrAlias moved this from In progress to Review in progress in OpenTelemetry Go 1.0.0 Jul 22, 2021
Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

nice progress 👍

Comment on lines 14 to 26
## [`otlptrace`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace)

The `otlptrace` package provides an exporter implementing the OTel span exporter interface.
This exporter is configured using a client satisfying the `otlptrace.Client` interface.
This client handles the transformation of data into wire format and the transmission of that data to the collector.

## [`otlptracegrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc)

The `otlptracegrpc` package implements a gRPC client to be used in the span exporter.

## [`otlptracehttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp)

The `otlptracehttp` package implements a HTTP client to be used in the span exporter.
Copy link
Member

Choose a reason for hiding this comment

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

We miss information about configuration via environmental variables. I am not sure which are supported (you would need to check the code/godoc/changelog). Here are the docs for the env vars that in theory should be supported: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md.

Here is a README how the env vars are documented for Jaeger exporter: https://github.com/open-telemetry/opentelemetry-go/blob/main/exporters/jaeger/README.md#environment-variables

Copy link
Member

Choose a reason for hiding this comment

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

I hope this will help you;

func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption {
var opts []GenericOption
// Endpoint
if v, ok := e.getEnvValue("ENDPOINT"); ok {
if isInsecureEndpoint(v) {
opts = append(opts, WithInsecure())
} else {
opts = append(opts, WithSecure())
}
opts = append(opts, WithEndpoint(trimSchema(v)))
}
if v, ok := e.getEnvValue("TRACES_ENDPOINT"); ok {
if isInsecureEndpoint(v) {
opts = append(opts, WithInsecure())
} else {
opts = append(opts, WithSecure())
}
opts = append(opts, WithEndpoint(trimSchema(v)))
}
// Certificate File
if path, ok := e.getEnvValue("CERTIFICATE"); ok {
if tls, err := e.readTLSConfig(path); err == nil {
opts = append(opts, WithTLSClientConfig(tls))
} else {
otel.Handle(fmt.Errorf("failed to configure otlp exporter certificate '%s': %w", path, err))
}
}
if path, ok := e.getEnvValue("TRACES_CERTIFICATE"); ok {
if tls, err := e.readTLSConfig(path); err == nil {
opts = append(opts, WithTLSClientConfig(tls))
} else {
otel.Handle(fmt.Errorf("failed to configure otlp traces exporter certificate '%s': %w", path, err))
}
}
// Headers
if h, ok := e.getEnvValue("HEADERS"); ok {
opts = append(opts, WithHeaders(stringToHeader(h)))
}
if h, ok := e.getEnvValue("TRACES_HEADERS"); ok {
opts = append(opts, WithHeaders(stringToHeader(h)))
}
// Compression
if c, ok := e.getEnvValue("COMPRESSION"); ok {
opts = append(opts, WithCompression(stringToCompression(c)))
}
if c, ok := e.getEnvValue("TRACES_COMPRESSION"); ok {
opts = append(opts, WithCompression(stringToCompression(c)))
}
// Timeout
if t, ok := e.getEnvValue("TIMEOUT"); ok {
if d, err := strconv.Atoi(t); err == nil {
opts = append(opts, WithTimeout(time.Duration(d)*time.Millisecond))
}
}
if t, ok := e.getEnvValue("TRACES_TIMEOUT"); ok {
if d, err := strconv.Atoi(t); err == nil {
opts = append(opts, WithTimeout(time.Duration(d)*time.Millisecond))
}
}
return opts
}

Copy link
Contributor

Choose a reason for hiding this comment

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

@pellared can you add this in a follow on PR?

Copy link
Member

Choose a reason for hiding this comment

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

@MrAlias Added to my TODO list. I will try to do it next week.

Copy link
Contributor

Choose a reason for hiding this comment

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

@MrAlias Added to my TODO list. I will try to do it next week.

🎉 thanks 😄

Copy link
Member

Choose a reason for hiding this comment

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

PR: #2222

exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
@pellared pellared added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jul 30, 2021
Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

This looks like an incremental improvement to the docs. Thanks for the contribution.

The suggestions are not blocking.

exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
exporters/otlp/otlptrace/README.md Outdated Show resolved Hide resolved
OpenTelemetry Go 1.0.0 automation moved this from Review in progress to Reviewer approved Aug 17, 2021
Submarinee and others added 3 commits August 19, 2021 16:55
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@MrAlias

This comment has been minimized.

@MrAlias
Copy link
Contributor

MrAlias commented Sep 2, 2021

This is the last PR blocking our next RC release. I'm going to see if I can push some code to move this along.

@MrAlias
Copy link
Contributor

MrAlias commented Sep 2, 2021

@dashpole @pellared please take another look.

@MrAlias MrAlias merged commit db317fc into open-telemetry:main Sep 2, 2021
OpenTelemetry Go 1.0.0 automation moved this from Reviewer approved to Done Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Provides helpful information pkg:exporter:otlp Related to the OTLP exporter package Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants