{
    "url": "https://delaparra-services.nl/knowledge-hub/cardinality",
    "locale": "en",
    "title": "cardinality: Knowledge hub | DeLaParra Services",
    "description": "The number of unique label combinations a metric has. High cardinality (e.g. user_id as a label) blows up storage and cost.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/cardinality",
        "nl": "https://delaparra-services.nl/nl/kennisbank/cardinality"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/cardinality.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/cardinality.md",
        "json": "https://delaparra-services.nl/knowledge-hub/cardinality.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/cardinality.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/cardinality.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality.csv",
            "encodingFormat": "text/csv",
            "name": "cardinality.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality.json",
            "encodingFormat": "application/json",
            "name": "cardinality.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality.md",
            "encodingFormat": "text/markdown",
            "name": "cardinality.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality.pdf",
            "encodingFormat": "application/pdf",
            "name": "cardinality.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality.zip",
            "encodingFormat": "application/zip",
            "name": "cardinality.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/cardinality/skills.zip",
            "encodingFormat": "application/zip",
            "name": "cardinality-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [cardinality](<https://delaparra-services.nl/knowledge-hub/cardinality>)\n\n  \n\nCategory: Observability \n\n# cardinality\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is cardinality?\n\n \n\ncardinality: The number of unique label combinations a metric has. High cardinality (e.g. user\\_id as a label) blows up storage and cost. Cardinality in monitoring is the number of unique combinations of label values a metric has. A metric ` http_requests ` with labels for method and status code has a few dozen combinations. Add ` user_id ` as a label and it can have millions.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about cardinality\n\n  \n\n### How is cardinality used in practice?\n\n \n\nEvery combination is stored as a separate time series. High cardinality makes monitoring systems like Prometheus slow and expensive, and can crash them outright.\n\n    \n\n### What should you keep in mind with cardinality?\n\n \n\nKeep labels to values with a small, fixed set of options: endpoint name, status class, region. Put unique identifiers such as user IDs, order numbers or full URLs in logs or traces instead, where they belong. A useful rule is to ask whether you would ever draw a separate line on a graph for each value. If not, it should not be a label.\n\n    \n\n### What does an example of cardinality look like?\n\n \n\n```\nhttp_requests{user_id=\"...\"} → millions of series = bad\n```\n\n \n\n## At a glance\n\n   CategoryObservability Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Observability terms\n\n \n\n- [burn rate](<https://delaparra-services.nl/knowledge-hub/burn-rate>) \n- [context propagation](<https://delaparra-services.nl/knowledge-hub/context-propagation>) \n- [counter](<https://delaparra-services.nl/knowledge-hub/counter>) \n- [Datadog](<https://delaparra-services.nl/knowledge-hub/datadog>) \n- [error budget](<https://delaparra-services.nl/knowledge-hub/error-budget>) \n- [gauge](<https://delaparra-services.nl/knowledge-hub/gauge>)\n\n \n\n[All terms starting with C](<https://delaparra-services.nl/knowledge-hub#letter-c>)\n\n \n\n## Skills\n\n \n\n- ### Sentry PHP SDK\n\n \n\nFull Sentry SDK setup for PHP. Use when asked to \"add Sentry to PHP\", \"install sentry/sentry\", \"setup Sentry in PHP\", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for PHP applications. Supports plain PHP, Laravel, and Symfony.\n\n [View skill](<https://delaparra-services.nl/skills/sentry-php-sdk>) [Download zip](<https://delaparra-services.nl/skills/sentry-php-sdk/download>) \n- ### Prometheus Configuration\n\n \n\nSet up Prometheus for comprehensive metric collection, storage, and monitoring of infrastructure and applications. Use when implementing metrics collection, setting up monitoring infrastructure, or configuring alerting systems.\n\n [View skill](<https://delaparra-services.nl/skills/prometheus-configuration>) [Download zip](<https://delaparra-services.nl/skills/prometheus-configuration/download>) \n- ### SLO Implementation\n\n \n\nDefine and implement Service Level Indicators (SLIs) and Service Level Objectives (SLOs) with error budgets and alerting. Use when establishing reliability targets, implementing SRE practices, or measuring service performance.\n\n [View skill](<https://delaparra-services.nl/skills/slo-implementation>) [Download zip](<https://delaparra-services.nl/skills/slo-implementation/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/cardinality/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Logging and monitoring for your app](<https://delaparra-services.nl/manuals/logging-en-monitoring>) \n- [Understanding common error messages](<https://delaparra-services.nl/manuals/foutmeldingen-begrijpen>)\n\n \n\n## Related services\n\n \n\n- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)\n\nPerhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet. \n- [AI code review](<https://delaparra-services.nl/services#service-05>)\n\nWhen you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment.\n\n \n\n## Need any help?\n\n \n\nStuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/cardinality)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/cardinality",
                "name": "cardinality: Knowledge hub | DeLaParra Services",
                "description": "The number of unique label combinations a metric has. High cardinality (e.g. user_id as a label) blows up storage and cost.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#term",
                    "name": "cardinality",
                    "description": "The number of unique label combinations a metric has. High cardinality (e.g. user_id as a label) blows up storage and cost.",
                    "termCode": "cardinality",
                    "url": "https://delaparra-services.nl/knowledge-hub/cardinality",
                    "inLanguage": "en",
                    "keywords": "Observability",
                    "dateModified": "2026-11-25T17:46:25+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is cardinality?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "The number of unique label combinations a metric has. High cardinality (e.g. user_id as a label) blows up storage and cost. Cardinality in monitoring is the number of unique combinations of label values a metric has. A metric http_requests with labels for method and status code has a few dozen combinations. Add user_id as a label and it can have millions."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is cardinality used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Every combination is stored as a separate time series. High cardinality makes monitoring systems like Prometheus slow and expensive, and can crash them outright."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with cardinality?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Keep labels to values with a small, fixed set of options: endpoint name, status class, region. Put unique identifiers such as user IDs, order numbers or full URLs in logs or traces instead, where they belong. A useful rule is to ask whether you would ever draw a separate line on a graph for each value. If not, it should not be a label."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What does an example of cardinality look like?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "http_requests{user_id=\"...\"} → millions of series = bad"
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/sentry-php-sdk#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/prometheus-configuration#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/slo-implementation#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/logging-en-monitoring#article"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/foutmeldingen-begrijpen#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "cardinality"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#dataset",
                "name": "cardinality",
                "description": "The number of unique label combinations a metric has. High cardinality (e.g. user_id as a label) blows up storage and cost.",
                "url": "https://delaparra-services.nl/knowledge-hub/cardinality",
                "identifier": "https://delaparra-services.nl/knowledge-hub/cardinality#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/cardinality#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Observability",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:25+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "cardinality.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "cardinality.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "cardinality.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "cardinality.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "cardinality.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "cardinality-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/cardinality/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:25+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}