-
Notifications
You must be signed in to change notification settings - Fork 45
[File based config] Support for default profiler's log ingest URL in declarative config #2518
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
Changes from all commits
87f1339
480405a
41cc08e
c56343d
3695261
43bd074
bc840e9
c98a601
8dd45fe
d1ec23b
838c47a
a6d691d
8196c59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,18 +47,17 @@ static LogRecordExporter fromConfig(ConfigProperties config) { | |
| static LogRecordExporter buildGrpcExporter( | ||
| ConfigProperties config, Supplier<OtlpGrpcLogRecordExporterBuilder> makeBuilder) { | ||
| OtlpGrpcLogRecordExporterBuilder builder = makeBuilder.get(); | ||
| String ingestUrl = Configuration.getConfigUrl(config); | ||
| if (ingestUrl != null) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [for reviewer] No need for null check now |
||
| builder.setEndpoint(ingestUrl); | ||
| } | ||
| String ingestUrl = Configuration.getIngestUrl(config); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it would be better to pass the ingest url to this method instead of the config?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your suggestion looks good, however now we have consistent method signatures for buildHttpExporter and buildGrpcExporter methods which improves readability. I'll merge this PR and then probably make a followup. |
||
| builder.setEndpoint(ingestUrl); | ||
|
|
||
| return builder.addHeader(EXTRA_CONTENT_TYPE, STACKTRACES_HEADER_VALUE).build(); | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
| static LogRecordExporter buildHttpExporter( | ||
| ConfigProperties config, Supplier<OtlpHttpLogRecordExporterBuilder> makeBuilder) { | ||
| OtlpHttpLogRecordExporterBuilder builder = makeBuilder.get(); | ||
| String ingestUrl = Configuration.getConfigUrl(config); | ||
| String ingestUrl = Configuration.getIngestUrl(config); | ||
|
|
||
| OtlpConfigUtil.configureOtlpExporterBuilder( | ||
| DATA_TYPE_LOGS, | ||
|
|
@@ -73,9 +72,8 @@ static LogRecordExporter buildHttpExporter( | |
| builder::setRetryPolicy, | ||
| builder::setMemoryMode); | ||
|
|
||
| if (ingestUrl != null) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [for reviewer] No need for null check now |
||
| builder.setEndpoint(ingestUrl); | ||
| } | ||
| builder.setEndpoint(ingestUrl); | ||
|
|
||
| return builder.addHeader(EXTRA_CONTENT_TYPE, STACKTRACES_HEADER_VALUE).build(); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[For reviewer] It now returns default ingest URL instead of
null, which is more consistent with the warning reported above.Configuration.getIngestUrl()method is called only fromLogExporterBuilderwhich then calls appropriate log exporter builder: OtlpGrpcLogRecordExporterBuilder or OtlpHttpLogRecordExporterBuilder. These use their own default URLs in case endpoint is undefined, but they are basically identical to these returned from Configuration.getIngestUrl() now.