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

Display a message about sampling at start-up #3700

Merged
merged 7 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ private static void overlayConfiguration(
// only fall back to default sampling configuration after all overlays have been performed
if (config.sampling.requestsPerSecond == null && config.sampling.percentage == null) {
config.sampling.requestsPerSecond = 5.0;
configurationLogger.info(
"Some telemetry may be sampled out because the default rate-limited sampling configuration has been applied (from version 3.4.0) in order to reduce the default billing cost. You can set the sampling configuration explicitly: https://learn.microsoft.com/azure/azure-monitor/app/java-standalone-config#sampling");
trask marked this conversation as resolved.
Show resolved Hide resolved
}
// only set role instance to host name as a last resort
if (config.role.instance == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ void warn(String message, Object... args) {
messages.add(new Message(ConfigurationLogLevel.WARN, message, args));
}

public void info(String message, Object... args) {
messages.add(new Message(ConfigurationLogLevel.INFO, message, args));
}

void debug(String message, Object... args) {
messages.add(new Message(ConfigurationLogLevel.DEBUG, message, args));
}
Expand Down Expand Up @@ -50,6 +54,12 @@ public void log(Logger logger, String message, Object... args) {
logger.warn(message, args);
}
},
INFO {
@Override
public void log(Logger logger, String message, Object... args) {
logger.info(message, args);
}
},
DEBUG {
@Override
public void log(Logger logger, String message, Object... args) {
Expand Down
Loading