Skip to content

Invalid metric format emitted for stats where to-zone/from-zone is empty #15541

Open

Description

@jessicayuen

Title: Invalid metric format emitted for stats where to-zone/from-zone is empty

Description:

What issue is being seen? Describe what should be happening instead of
the bug, for example: Envoy should not crash, the expected value isn't
returned, etc.

Stats are being emitted from Envoy with consecutive .. between namespaces due to empty to-zone,
for example:

cluster.egress_dynamodb_iad.zone.1a..upstream_rq_2xx

Repro steps:

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

Do not specify an AZ for an upstream cluster.
Inspect the AZ-AZ stats via curl on admin.

Admin and Stats Output:

Include the admin output for the following endpoints: /stats,
/clusters, /routes, /server_info. For more information, refer to the
admin endpoint documentation.

> /stats
cluster.egress_dynamodb_iad.zone.1b..upstream_rq_200: 290642
cluster.egress_dynamodb_iad.zone.1b..upstream_rq_2xx: 290642
cluster.egress_dynamodb_iad.zone.1b..upstream_rq_completed: 290642

Activity

  1. added
    triage
    on Mar 17, 2021
  2. added
    help wanted
    and removed
    triage
    on Mar 17, 2021
  3. mattklein123 commented on Mar 17, 2021

    @mattklein123
    Member

    cc @jmarantz I think Jess is going to fix this but may reach out to you for tips.

  4. jmarantz commented on Mar 18, 2021

    @jmarantz
    Contributor

    @jessicayuen if you've started on this please lmk if you have any questions. I had forgotten the details on why the loop in SymbolTableImpl::addTokensToEncoding does not just skip empty tokens.

  5. jmarantz commented on Mar 18, 2021

    @jmarantz
    Contributor

    Making the above change results in just two unit tests failing that just need regolds I think, and the fuzz test.

    Do you have a unit test for this specific issue?

  6. jessicayuen commented on Mar 18, 2021

    @jessicayuen
    MemberAuthor

    Thanks @jmarantz I plan to make the fix over the week. I don't believe there is a unit test for this issue since we internally caught this via a metrics audit of the /stats endpoint. I'll add a test though. Will reach out to you if I have any questions!

  7. jmarantz commented on Mar 18, 2021

    @jmarantz
    Contributor

    For a unit test I was thinking something in upstream_impl_test that poked in an empty zone and verified that the right stat-names get created.

    The fix should be easy.

  8. jessicayuen commented on Mar 19, 2021

    @jessicayuen
    MemberAuthor

    The fix should be easy.

    perfect, looking for something small to help me get acquainted with the codebase :)

  9. jmarantz commented on Mar 19, 2021

    @jmarantz
    Contributor

    Great. Happy to help. Quick suggestion; if you haven't seen it, you might wan to take a quick look at https://github.com/envoyproxy/envoy/blob/main/source/docs/stats.md#stat-naming-infrastructure-and-memory-consumption to get an idea of the StatName structure.

  10. added a commit that references this issue on Apr 29, 2021
    d359119
  11. jmarantz commented on May 26, 2021

    @jmarantz
    Contributor

    if (!info.from_zone_.empty() && !info.to_zone_.empty()) {
    makes me wonder how this bug can happen. Maybe more detail would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions