Skip to content

[Bug]: /metrics endpoint does not escape hyphens #59247

@ainola

Description

@ainola

⚠️ This issue respects the following points: ⚠️

Bug description

I set up my prometheus server to scrape the new /metrics endpoint and have found out that it doesn't like apps with hyphens in the name! I have the "hide-photos" app installed and the ingestion fails once it reaches that character:

expected equal, got "-" ("INVALID") while parsing: "nextcloud_apps_info{activity=\"6.0.0-dev.0\",admin_audit=\"1.23.0\",[...]maps=\"1.6.0\",hide-"

Steps to reproduce

  1. Install "hide-photos" app
  2. Set up Prometheus server to scrape /metrics
  3. View Prometheus' logs or the "Targets" page of the web UI

Expected behavior

Hyphens not breaking things!

Nextcloud Server version

33

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.4

Web server

Nginx

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap33-feedbackbug

    Type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions