GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Guide
  • Examples
  • Log in
  • Sign up

This view

  • Original page
  • New address

GeezerVison is showing modal.com — Connecting Modal to your OpenTelemetry Provider

Guide Introduction to Modal Getting started Functions Functions Invocation methods Function lookups Container lifecycle management Parametrized Functions Dynamic configuration Sandboxes Sandboxes Running commands Networking and security File access Snapshots Exit Snapshots BetaPricing and resources Sidecars BetaSecret injection BetaModel APIs Model APIs Models and pricing Agent integrations Endpoints Endpoints Supported models Candidates Training Quickstart Tinker-compatible API BetaMulti-node training Images Defining Images Using existing container images Named images Fast pull from registry GPUs and other resources GPU acceleration Using CUDA on Modal Configuring CPU, memory, and disk Scaling out Scaling out Input concurrency Batch processing Job queues Dynamic batching Multi-node Clusters Deployment Apps, Functions, and entrypoints Managing deployments Continuous deployment Scheduled Functions Observability HTTP Applications Servers Sticky Sessions Web Functions Streaming endpoints Web Function URLs Request timeouts Proxy Tokens Networking Tunnels Proxies BetaCluster networking Data sharing and storage Passing local data Volumes Storing model weights Cloud bucket mounts Dicts Queues Dataset ingestion Secrets and environment variables Secrets Environment variables Performance Cold start performance Memory Snapshots High-performance LLM inference Reliability and robustness Failures and retries Preemption Timeouts GPU health Troubleshooting Security and privacy Security and privacy Data residency Customer-supplied encryption keys AlphaAudit logs Integrations Using OIDC to authenticate with external services Connecting Modal to your Datadog account Connecting Modal to your OpenTelemetry provider Slack notifications Workspace & account settings Workspaces Environments Service users User groups Role-Based Access Control (RBAC) Billing Network egress billing Budgets Identity and provisioning Okta SSO Microsoft Entra SSO Google Workspace SSO Custom SAML SSO SCIM Integration Other topics Feature maturity Restricted Functions JavaScript/Go SDKs BetaModal 1.0 migration guide File and project structure Developing and debugging Jupyter notebooks Asynchronous API usage Global variables Region selection Localized placement GPU Metrics Search syntax

Connecting Modal to your OpenTelemetry Provider

You can export Modal logs to your OpenTelemetry provider using the Modal OpenTelemetry integration. This integration is compatible with any observability provider that supports the OpenTelemetry HTTP APIs.

What this integration does 

This integration allows you to:

  1. Export Modal audit logs to your provider
  2. Export Modal Function logs to your provider
  3. Export container metrics to your provider

Metrics 

The Modal OpenTelemetry Integration will forward the following metrics to your provider:

  • modal.cpu.utilization
  • modal.memory.usage
  • modal.gpu.memory.usage
  • modal.gpu.compute.utilization
  • modal.gpu.power.usage
  • modal.gpu.power.utilization
  • modal.gpu.temperature
  • modal.gpu.clock
  • modal.gpu.count
  • modal.network.egress.bytes
  • modal.network.ingress.bytes
  • modal.container.running
  • modal.container.terminations
  • modal.input_events.elapsed_time_us
  • modal.input_events.input_queue_time_us
  • modal.input_events.coldstart_time_us
  • modal.input_events.successes
  • modal.input_events.total_inputs
  • modal.function.pending_inputs
  • modal.function.running_inputs

Deprecated metrics:

  • modal.memory.utilization (use modal.memory.usage)
  • modal.gpu.memory.utilization (use modal.gpu.memory.usage)

modal.network.egress.bytes counts the bytes a container sends, the same traffic metered for network egress billing.

modal.input_events.successes and modal.input_events.total_inputs can be used to measure the success rate of a certain function or app.

These metrics are tagged with container_id, environment_name, app_name, app_id, function_name, function_id, workspace_name, and workspace_id. Metrics from GPU containers are additionally tagged with gpu_billing_type, the GPU type the container is billed as (e.g. H100), which may differ from the physical GPU model when a workload is scheduled onto a newer GPU. Metrics from Sandboxes are additionally tagged with sandbox_id. modal.container.terminations is instead tagged with container_id, environment_name, app_name, app_id, workspace_name, workspace_id, object_id, object_type, and reason.

Custom metrics 

Beta
This feature is in Beta.

Contact us to enable custom metrics for your workspace.

We'd love to hear your feedback — please reach out via Slack or email us at [email protected].

The Modal OpenTelemetry Integration allows you to send custom metrics and spans to your provider. You will then need to export our collector environment variables. These configure the OpenTelemetry SDK to send messages to our collector in HTTP format. You don’t need to do this to get the out-of-the-box metrics above, only for your own custom metrics.

@app.function(
   secrets=[modal.Secret.from_dict({
      "OTEL_EXPORTER_OTLP_ENDPOINT": "otlp-collector.modal.local:4317",
      "OTEL_EXPORTER_OTLP_INSECURE": "true",
      "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
   })],
)
def custom_metrics():
   ...

All OpenTelemetry SDKs should pick this configuration up, and your custom metrics and spans will be sent to your configured provider.

Installing the integration 

  1. Find out the endpoint URL for your OpenTelemetry provider. This is the URL that the Modal integration will send logs to. Note that this should be the base URL of the OpenTelemetry provider, and not a specific endpoint. For example, for the US New Relic instance, the endpoint URL is https://otlp.nr-data.net, not https://otlp.nr-data.net/v1/logs.
  2. Find out the API key or other authentication method required to send logs to your OpenTelemetry provider. This is the key that the Modal integration will use to authenticate with your provider. Modal can provide any key/value HTTP header pairs. For example, for New Relic, the header is api-key.
  3. Create a new OpenTelemetry Secret in Modal with one key per header. These keys should be prefixed with OTEL_HEADER_, followed by the name of the header. The value of this key should be the value of the header. For example, for New Relic, an example Secret might look like OTEL_HEADER_api-key: YOUR_API_KEY. If you use the OpenTelemetry Secret template, this will be pre-filled for you.
  4. Navigate to the Modal metrics settings page and configure the OpenTelemetry push URL from step 1 and the Secret from step 3.
  5. Save your changes and use the test button to confirm that logs are being sent to your provider. If it’s all working, you should see a Hello from Modal! 🚀 log from the modal.test_logs service.

Uninstalling the integration 

Once the integration is uninstalled, all logs will stop being sent to your provider.

  1. Navigate to the Modal metrics settings page and disable the OpenTelemetry integration.
Connecting Modal to your OpenTelemetry ProviderWhat this integration doesMetricsCustom metricsInstalling the integrationUninstalling the integration
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.