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

Make the Resource accessible to Logging Library SDK #1330

Open
vovencij opened this issue Jan 11, 2021 · 8 comments
Open

Make the Resource accessible to Logging Library SDK #1330

vovencij opened this issue Jan 11, 2021 · 8 comments
Labels
area:api Cross language API specification issue area:sdk Related to the SDK help wanted Extra attention is needed release:after-ga Not required before GA release, and not going to work on before GA spec:logs Related to the specification/logs directory spec:resource Related to the specification/resource directory

Comments

@vovencij
Copy link
Contributor

vovencij commented Jan 11, 2021

What are you trying to achieve?
I want to enrich legacy first-party application logs with resource information. In order to do so, I have to make resource attributes accessible while configuring logging patterns. Logging happens in user code, but the Resource is currently a part of SDK, rather than API, which means that an application must depend on SDK, rather than API, to write resource attributes to a log file.

Additional context.

Related issue in opentelemetry-java: open-telemetry/opentelemetry-java#2466

@vovencij vovencij added the spec:resource Related to the specification/resource directory label Jan 11, 2021
@Oberon00 Oberon00 added area:api Cross language API specification issue area:sdk Related to the SDK spec:logs Related to the specification/logs directory labels Jan 11, 2021
@Oberon00
Copy link
Member

Do you see any other use cases for reading these resource attributes, besides logging?

@vovencij
Copy link
Contributor Author

At the moment I don't see any other relevant use cases besides logging.

@anuraaga
Copy link
Contributor

anuraaga commented Jan 11, 2021

Something that comes to mind is bringing in resource information for logic such as determining experiment IDs for a server. For example, if experiment is based on deployment name. Detection logic for the system for use in multiple places would otherwise need to be duplicated. Maybe it's expected though since such logic isn't telemetry.

@vovencij
Copy link
Contributor Author

@tigrannajaryan what's your take on this?

@carlosalberto
Copy link
Contributor

cc @bogdandrutu

@Oberon00
Copy link
Member

Another advantage of making Resources part of the API is that custom resource detectors, etc. could be used by other API implementations beside the default SDK (depending on how we would design the SDK/API-split)

@andrewhsu andrewhsu added the release:after-ga Not required before GA release, and not going to work on before GA label Jan 12, 2021
@tigrannajaryan
Copy link
Member

Exposing Resources only via SDK never felt quite right to me anyway. Generally, I think everything the end user needs to interact with should be in the API.

With the risk of opening a can of worms a bit more on this.

Historically we limited this to operations that are used by instrumentation and excluded operations that need to be performed by application developers (e.g. the setup and configuration).

I do not think this is the right delineation approach. All end-user callable functionality should be in the API, including what application developers are expected to do for the purpose of setting up telemetry. Resource API falls into this category.

I think we can make this transition of operations from SDK to API gradually, without breaking API or SDK compatibility.

Either way, regardless of what we decide regarding all other SDK features, I think Resource needs to be in the API. We did not yet declare SDK stable so technically we are free to remove the Resource from SDK. However this may clash with our GA plans, so it may be easier to keep it in the SDK and expose what is necessary in the API (will need to think if it may cause any confusion due to exposing the same functionality in 2 places).

@tigrannajaryan
Copy link
Member

I think we need to make it clear in the Logging Library SDK proposal how the Resource can be fetched from the SDK by the Logging Library SDK. If we do that then there is no longer a need to make the Resource part of the user-accessible API.

@tigrannajaryan tigrannajaryan added the help wanted Extra attention is needed label Oct 13, 2021
@tigrannajaryan tigrannajaryan changed the title Make the Resource part of API Make the Resource accessible to Logging Library SDK Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue area:sdk Related to the SDK help wanted Extra attention is needed release:after-ga Not required before GA release, and not going to work on before GA spec:logs Related to the specification/logs directory spec:resource Related to the specification/resource directory
Projects
None yet
Development

No branches or pull requests

6 participants