Skip to content

add build-time android.util.Log call-site substitutions#911

Merged
LikeTheSalad merged 5 commits into
open-telemetry:mainfrom
cleverchuk:cc/log
Apr 4, 2025
Merged

add build-time android.util.Log call-site substitutions#911
LikeTheSalad merged 5 commits into
open-telemetry:mainfrom
cleverchuk:cc/log

Conversation

@cleverchuk
Copy link
Copy Markdown
Contributor

maybe fixes #142

@cleverchuk cleverchuk requested a review from a team as a code owner March 26, 2025 15:54
Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

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

Thanks! This is a great start.


public class AndroidLogSubstitutions {

public static String TAG_KEY = "android.tag";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, the guidance is more to use the AttributeKey class, because avoids having to make a new AttributeKey each time (like the pure string version does).

Suggested change
public static String TAG_KEY = "android.tag";
public final static AttributeKey<String> TAG_KEY = AttributeKey.stringKey("android.tag");

@breedx-splk
Copy link
Copy Markdown
Contributor

Along with our goal of having READMEs for each instrumentation that describe the telemetry they omit, I think we should include a README in this PR. Thanks!

Comment thread instrumentation/android-log/README.md Outdated
Copy link
Copy Markdown
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

This is looking good, @cleverchuk thanks for the submission! I'd like us to reference the semconv before merging, and I think we should open an issue to convert some of the assertions to use the upstream test utils, which has more expressive type-specific assertsions for the logs classes....but I think we're close. 😎

@cleverchuk cleverchuk requested a review from breedx-splk April 2, 2025 17:22
Comment thread instrumentation/android-log/README.md Outdated
Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

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

Thank you 🙏

@LikeTheSalad LikeTheSalad merged commit fb9f8c8 into open-telemetry:main Apr 4, 2025
6 checks passed
@cleverchuk cleverchuk deleted the cc/log branch June 17, 2025 14:40
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.

Feature: Android OTEL Logging exporter

3 participants