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

Missing error metrics on new_relic sink #18297

Open
bosouza opened this issue Aug 17, 2023 · 5 comments
Open

Missing error metrics on new_relic sink #18297

bosouza opened this issue Aug 17, 2023 · 5 comments
Labels
domain: observability Anything related to monitoring/observing Vector meta: confirmed A bug that has been reproduced or confirmed. sink: new_relic Anything `new_relic` sink related type: bug A code related bug.

Comments

@bosouza
Copy link

bosouza commented Aug 17, 2023

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

I was trying to use Vector sink metrics to determine a "sink health", but when looking at the metrics emitted by the new_relic sink when configured with incorrect credentials I didn't find component_errors_total or component_discarded_events_total.

Also, component_received_events_total and component_sent_events_total both increase together even though none of the logs actually reach the provider because the credentials are wrong.

There are also some metrics which are not documented in the telemetry section for the sink: http_client_requests_sent_total and http_client_responses_total.

Please run the config provided in this report to reproduce the behavior I'm seeing.

Configuration

{
    "sources": {
        "demo-logs": {
            "type": "demo_logs",
            "format": "json"
        },
        "internal-metrics": {
            "type": "internal_metrics"
        }
    },
    "transforms": {
        "internal-metrics-as-logs": {
            "type": "metric_to_log",
            "inputs": ["internal-metrics"]
        }
    },
    "sinks": {
        "new-relic": {
            "type": "new_relic",
            "inputs": ["demo-logs"],
            "account_id": "10101010",
            "license_key": "invalidcredentials",
            "api": "logs"
        },
        "sink-metrics": {
            "type": "file",
            "encoding": {"codec": "json"},
            "path": "./new-relic-sink-metrics.log",
            "inputs": ["internal-metrics-as-logs"]
        }
    }
}

Version

vector 0.32.0 (x86_64-unknown-linux-gnu 1b403e1 2023-08-15 14:56:36.089460954)

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@bosouza bosouza added the type: bug A code related bug. label Aug 17, 2023
@pront
Copy link
Contributor

pront commented Aug 18, 2023

Similar to #18296.

@pront pront closed this as completed Aug 18, 2023
@bosouza
Copy link
Author

bosouza commented Aug 18, 2023

@pront this is a bit different

Also, component_received_events_total and component_sent_events_total both increase together even though none of the logs actually reach the provider because the credentials are wrong.

if the events are stuck forever on retries like in #18296 then they shouldn't be counting towards component_sent_events_total right?

@pront pront reopened this Aug 18, 2023
@dsmith3197
Copy link
Contributor

Hey @bosouza,

What status codes do you see reported for http_client_responses_total?

@dsmith3197 dsmith3197 added sink: new_relic Anything `new_relic` sink related domain: observability Anything related to monitoring/observing Vector labels Dec 18, 2023
@bosouza
Copy link
Author

bosouza commented Dec 18, 2023

looking at the logs from my tests a few months ago it's all 403s. Just to be sure I ran the example config from the issue description with vector 0.34.1 and got the same thing:

{"counter":{"value":1.0},"host":"m15","kind":"absolute","name":"http_client_responses_total","namespace":"vector","tags":{"status":"403"},"timestamp":"2023-12-18T19:11:09.052219083Z"}

@dsmith3197
Copy link
Contributor

@bosouza Thanks, I think I see the problem. I took a quick look at the source code for the new relic sink and we actually ignore the status code of the response and always report a successful delivery, which explains the behavior you are experiencing.

Ok(_) => Ok(NewRelicApiResponse {

@dsmith3197 dsmith3197 added the meta: confirmed A bug that has been reproduced or confirmed. label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: observability Anything related to monitoring/observing Vector meta: confirmed A bug that has been reproduced or confirmed. sink: new_relic Anything `new_relic` sink related type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

3 participants