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

Ability to configure LogginerEmitter to only emit metrics or only alerts or both #17

Closed
wants to merge 2 commits into from

Conversation

himanshug
Copy link
Contributor

most of the monitoring systems can't handle the stack-traces druid alerts contain, however they contain useful information.. we want the ability to push metrics to other systems and yet be able to log just the alerts in the process logs. This PR combined with composing emitter enables doing that with other emitters such as http post.

also, a bit of cleanup in Logging/Http EmitterConfigTest

}
break;
default:
throw new ISE("unknown log events eventsToLog [%s].", eventsToLog);
Copy link
Contributor

Choose a reason for hiding this comment

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

"eventsToLog set to [%s], possible values are ALL, ALERTS or METRICS " ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

@rasahner
Copy link

There will be a new property druid.emitter.logging.eventsToLog in druid.io configuration.md?

@himanshug
Copy link
Contributor Author

@rasahner yes, will add that once this PR is merged.

@himanshug
Copy link
Contributor Author

@drcrallen @xvrl @nishantmonu51 can one of you pls review/merge this one?

import java.util.Map;
import java.util.Properties;

public class Emitters
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason we are removing this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its not needed anymore, it was used by unit tests and was doing unnecessary conversions. pls see the updated unit tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

we still use this class internally in other projects, so we cannot remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, ok, let me add it back then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xvrl added it back.

@himanshug
Copy link
Contributor Author

@xvrl pls merge if there are no further comments.

final ObjectMapper objectMapper = new ObjectMapper();
final HttpEmitterConfig config = objectMapper.convertValue(Emitters.makeHttpMap(props), HttpEmitterConfig.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like we are removing testing of Emitters.makeHttpMap here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is true.
does the other code you have that creates object doesn't do it the way druid does and instead relies on the property transformations in Emitters.makeHttpMap?

@drcrallen
Copy link
Contributor

@himanshug sorry this sat for a bit, is it still needed?

@himanshug
Copy link
Contributor Author

@drcrallen we really wanted to use logging emitter to print alerts in logs but it appears they are always printed as error messages in the logs , so there wasn't a major need. however it will be nice to have this capacity at some point.

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.

5 participants