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

Logstasher instrumentation #2559

Merged
merged 56 commits into from
Jul 11, 2024
Merged

Logstasher instrumentation #2559

merged 56 commits into from
Jul 11, 2024

Conversation

hannahramadan
Copy link
Contributor

@hannahramadan hannahramadan commented Apr 15, 2024

Add support for LogStasher gem versions 1.0.0 and above.

Full CI run: https://github.com/newrelic/newrelic-ruby-agent/actions/runs/9861763118
Test Coverage: 100% new code coverage

closes #2399

@hannahramadan hannahramadan changed the title Draft: Instrumentation skeleton Draft: Logstasher instrumentation Apr 15, 2024
hannahramadan and others added 8 commits June 11, 2024 16:32
if the log decorator is given a hash, merge the metadata into the hash
separate out the `return` logic and the `merge` logic to ensure that
hashes always result in an early return
- Aggregator: check for LogStasher
- Instrumentation: reurn data v log
- Aggregator: don't alter original log
@kaylareopelle kaylareopelle self-requested a review July 3, 2024 00:42

if NewRelic::Agent.config[METRICS_ENABLED_KEY]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A few blocks of code were shared by create_event and create_logstasher_event. This is an example of a block of code moved into a new method (increment_event_counters is the name for this)

return if severity_too_low?(severity)
return if formatted_message.nil? || formatted_message.empty?
return unless NewRelic::Agent.config[FORWARDING_ENABLED_KEY]
return if @high_security
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This block of code lives in a new method, monitoring_conditions_met?

@hannahramadan hannahramadan marked this pull request as ready for review July 9, 2024 19:06
@hannahramadan hannahramadan changed the title Draft: Logstasher instrumentation Logstasher instrumentation Jul 9, 2024
Copy link

github-actions bot commented Jul 9, 2024

SimpleCov Report

Coverage Threshold
Line 93.84% 93%
Branch 70.86% 50%

@hannahramadan hannahramadan merged commit 49c220a into dev Jul 11, 2024
32 checks passed
@hannahramadan hannahramadan deleted the logstasher_instrumentation branch July 11, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Complete/Done
Development

Successfully merging this pull request may close these issues.

Add support for Logstasher
3 participants