Skip to content

[File based config] Support for default profiler's log ingest URL in declarative config#2518

Merged
robsunday merged 13 commits intosignalfx:mainfrom
robsunday:fbc-profiler
Nov 6, 2025
Merged

[File based config] Support for default profiler's log ingest URL in declarative config#2518
robsunday merged 13 commits intosignalfx:mainfrom
robsunday:fbc-profiler

Conversation

@robsunday
Copy link
Copy Markdown
Contributor

In declarative config there is no support for otel.exporter.otlp.endpoint and otel.exporter.otlp.protocol properties.
Until now Configuration.getIngestUrl returned null for declarative config in case splunk.profiler.logs-endpoint was not defined.

Now Configuration.getIngestUrl returns "http://localhost:4318/v1/logs" or "http://localhost:4317", depending on value of profiler otlp protocol (default is "http/protobuf")

+ "You can override it by setting "
+ CONFIG_KEY_INGEST_URL,
new Object[] {ingestUrl, defaultIngestUrl});
return defaultIngestUrl;
Copy link
Copy Markdown
Contributor Author

@robsunday robsunday Nov 5, 2025

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 from LogExporterBuilder which 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.

ConfigProperties config, Supplier<OtlpGrpcLogRecordExporterBuilder> makeBuilder) {
OtlpGrpcLogRecordExporterBuilder builder = makeBuilder.get();
String ingestUrl = Configuration.getConfigUrl(config);
if (ingestUrl != null) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[for reviewer] No need for null check now

builder::setRetryPolicy,
builder::setMemoryMode);

if (ingestUrl != null) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[for reviewer] No need for null check now

@robsunday robsunday marked this pull request as ready for review November 5, 2025 12:56
@robsunday robsunday requested review from a team as code owners November 5, 2025 12:56
@robsunday robsunday changed the title [File based config] Return default URL from Configuration.getIngestUrl(config) [File based config] Support for default ingest URL in declarative config Nov 5, 2025
@robsunday robsunday changed the title [File based config] Support for default ingest URL in declarative config [File based config] Support for default profiler's log ingest URL in declarative config Nov 5, 2025
if (ingestUrl != null) {
builder.setEndpoint(ingestUrl);
}
String ingestUrl = Configuration.getIngestUrl(config);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

@robsunday robsunday merged commit 9299870 into signalfx:main Nov 6, 2025
28 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants