Skip to content

Conversation

@kkondaka
Copy link
Collaborator

@kkondaka kkondaka commented Nov 1, 2025

Description

Add Prometheus Sink.
Only supports Amazon Promethus Sink as the destination with AWS credentials.

Issues Resolved

Resolves #3028

Check List

  • [X ] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • [ X] Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Kondaka <krishkdk@amazon.com>
Signed-off-by: Kondaka <krishkdk@amazon.com>
Signed-off-by: Kondaka <krishkdk@amazon.com>
Signed-off-by: Kondaka <krishkdk@amazon.com>
@KarstenSchnitter
Copy link
Collaborator

How much effort would be required to make this compatible with a standard Prometheus instance, e.g. prom/prometheus?

@kkondaka
Copy link
Collaborator Author

kkondaka commented Nov 4, 2025

@KarstenSchnitter I think it should work with any prometheus server once we support different auth mechanisms. May be the simplest one maybe username/password auth support

Comment on lines +100 to +102
.with("statusCode", statusCode)
.with("pluginName", pluginSetting.getName())
.with("pipelineName", pluginSetting.getPipelineName());
Copy link
Member

Choose a reason for hiding this comment

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

Should this metadata be made into variables? Seems like common metadata all sinks may use

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could. Is it OK to do this as a separate followup PR?

@KarstenSchnitter
Copy link
Collaborator

@kkondaka can you add basic auth support? Other authentications can be added on request.

Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

Thanks @kkondaka ! This is a great improvement. I took an initial look and left some comments.

Region region = (awsConfig != null) ? awsConfig.getAwsRegion() : awsCredentialsSupplier.getDefaultRegion().get();

sinkMetrics = new DefaultSinkMetrics(pluginMetrics, "metric");
httpSender = new PrometheusHttpSender(awsCredentialsSupplier, prometheusSinkConfiguration, sinkMetrics, prometheusSinkConfiguration.getConnectionTimeoutMs(), prometheusSinkConfiguration.getIdleTimeoutMs());
Copy link
Member

Choose a reason for hiding this comment

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

Let's start moving toward dependency injection. This is support now. You can see an example of this in PR #6190. I added DI to the DynamoDB source coordinator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will do this in a fast-followup PR

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class PrometheusSinkTest {
Copy link
Member

Choose a reason for hiding this comment

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

We should have at least one test that uses the test plugin framework to verify behavior. See GrokProcessorIT as an example. At the very least it will get the automatic tests that verify that the plugin can load.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will do this in a fast-followup PR

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.

Support Prometheus as a Sink storage (remote-write model)

4 participants