Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Monitoring Squid with OpenTelemetry Collector

This simple example demonstrates monitoring Squid Web Proxy Cache prometheus metrics with the OpenTelemetry collector, using the prometheus receiver and sending the data to New Relic via OTLP.

Requirements

Running the example

  1. Update the NEW_RELIC_API_KEY value in secrets.yaml to your New Relic license key.

    # ...omitted for brevity
    stringData:
      # New Relic API key to authenticate the export requests.
      # docs: https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key
      NEW_RELIC_API_KEY: <INSERT_API_KEY>
    • Note, be careful to avoid inadvertent secret sharing when modifying secrets.yaml. To ignore changes to this file from git, run git update-index --skip-worktree k8s/secrets.yaml.

    • If your account is based in the EU, update the NEW_RELIC_OTLP_ENDPOINT value in collector.yaml the endpoint to: https://otlp.eu01.nr-data.net

    # ...omitted for brevity
    env:
     # The default US endpoint is set here. You can change the endpoint and port based on your requirements if needed.
     # docs: https://docs.newrelic.com/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/best-practices/opentelemetry-otlp/#configure-endpoint-port-protocol
     - name: NEW_RELIC_OTLP_ENDPOINT
       value: https://otlp.eu01.nr-data.net
  2. Set the SQUID_CACHEMGR env var value in collector.yaml. The value is used to identify the squid entity in New Relic.

    # ...omitted for brevity
    # A unique identifier for the instance of the squid cache manager being monitored, used as the entity name in New Relic.
    - name: SQUID_CACHEMGR
     value: <INSERT_SQUID_IDENTIFIER>
  3. Run the application with the following command.

    kubectl apply -f k8s/
    • When finished, cleanup resources with the following command. This is also useful to reset if modifying configuration.
    kubectl delete -f k8s/

Viewing your data

To review your squid data in New Relic, navigate to "New Relic -> All Entities -> Squid Cache managers" and click on the instance with name corresponding to the SQUID_CACHEMGR env var value to view the instance summary. Use NRQL to perform ad-hoc analysis.

FROM Metric SELECT uniques(metricName) WHERE otel.library.name = 'otelcol/prometheusreceiver' AND metricName like 'squid%' LIMIT MAX

See get started with querying for additional details on querying data in New Relic.

Additional notes

This example monitors a squid instance defined in squid.yaml, with squid-exporter running in a sidecar container. To use in production, you'll need to modify the .receivers.prometheus.config.scrape_configs[0].static_configs[0].targets value in collector.yaml ConfigMap to point to the squid-exporter target corresponding to your squid instance.