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

Remove use of service.name in example & Add info about OTEL_SERVICE_NAME #3018

Merged
merged 5 commits into from
Jul 15, 2023

Conversation

geekrypter
Copy link
Contributor

@geekrypter geekrypter commented Jul 12, 2023

What is the change?
This change removes use of service.name in example and adds some information about setting service.name resource attribute via the environment variable OTEL_SERVICE_NAME in the resources.md file of JS docs.

Why the change?
This change contributes to #1830

@geekrypter geekrypter requested review from a team July 12, 2023 09:06
@svrnm svrnm linked an issue Jul 12, 2023 that may be closed by this pull request
Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Looks good. 🙂 Unrelated to this PR, but I wonder if we should mention that the env detector is only added automatically when the SDK is set up with @opentelemetry/sdk-node

content/en/docs/instrumentation/js/resources.md Outdated Show resolved Hide resolved
@svrnm
Copy link
Member

svrnm commented Jul 14, 2023

Looks good. 🙂 Unrelated to this PR, but I wonder if we should mention that the env detector is only added automatically when the SDK is set up with @opentelemetry/sdk-node

Yeah, that might be worthwhile as it is not 100% obvious from that page, although there is a call out at the top that this assumes that people followed the getting started

@@ -66,11 +66,13 @@ In the above example, the SDK detected the process and also added the
Below you will find instructions to get resources detected automatically for
you. However, you might run into the situation that no detector exists for the
resource you need. In that case you can use the environment
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. For example the
following script adds [Service][], [Host][] and [OS][] resource attributes:
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. You can use the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. You can use the
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. Additionally you can use the

minor suggestion otherwise LGTM!

Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a comma after "Additionally".

Copy link
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

See inline comments.

@@ -66,11 +66,13 @@ In the above example, the SDK detected the process and also added the
Below you will find instructions to get resources detected automatically for
you. However, you might run into the situation that no detector exists for the
resource you need. In that case you can use the environment
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. For example the
following script adds [Service][], [Host][] and [OS][] resource attributes:
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. You can use the
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be a comma after "Additionally".

@@ -66,11 +66,13 @@ In the above example, the SDK detected the process and also added the
Below you will find instructions to get resources detected automatically for
you. However, you might run into the situation that no detector exists for the
resource you need. In that case you can use the environment
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
resource you need. In that case you can use the environment
resource you need. In that case, use the environment variable

following script adds [Service][], [Host][] and [OS][] resource attributes:
`OTEL_RESOURCE_ATTRIBUTES` to inject whatever you need. You can use the
environment variable `OTEL_SERVICE_NAME` to set value of the `service.name`
resource attribute. For example the following script adds [Service][], [Host][]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
resource attribute. For example the following script adds [Service][], [Host][]
resource attribute. For example, the following script adds [Service][], [Host][]

@cartermp cartermp merged commit 0bb9121 into open-telemetry:main Jul 15, 2023
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.

Resources doc - reconsider use of service.name in example
6 participants