Visitar URL original
[java-bigtable] add bigtable_table_id attribute to opencensus stats / traces · Issue #13085 · googleapis/google-cloud-java · GitHub
Skip to content

[java-bigtable] add bigtable_table_id attribute to opencensus stats / traces #13085

Description

@mackenziestarr

Is your feature request related to a problem? Please describe.

It is useful to understand the distribution of latency and errors across tables for a given bigtable instance. The opencensus stats already include a lot of helpful attributes but bigtable_table_id would open up a lot of opportunities for debugging.

Describe the solution you'd like

Include bigtable_table_id in the opencensus stats and trace attributes

Describe alternatives you've considered

Not doing it and being a bit disappointed

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    triage meI really want to be triaged.
    on Oct 16, 2020
  2. self-assigned this
    on Oct 22, 2020
  3. removed their assignment
    on Nov 5, 2020
  4. igorbernstein2 commented on Jan 5, 2021

    @igorbernstein2
    Contributor

    Hi, sorry for the late reply here. The current design decisions make this a fairly difficult feature to implement. All of the tags that we currently populate are known during client construction time. Table ids are not known until the request is created, which is why they don't currently exist.

  5. added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Jan 5, 2021
  6. mackenziestarr commented on Jan 7, 2021

    @mackenziestarr
    Author

    @igorbernstein2 thanks for the update and getting this prioritized

  7. rravi-sift commented on Aug 3, 2023

    @rravi-sift

    Hi @igorbernstein2, bumping up this feature request, we are also interested in this feature since we have many tables in an instance. It looks like BuiltInMetricsTracer supports this feature, could this be extended to MetricsTracer as well? https://github.com/googleapis/java-bigtable/blob/69100478d5d9478dcb5bf1bd6fb56ee13573d326/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java#L117-L119

  8. igorbernstein2 commented on Aug 8, 2023

    @igorbernstein2
    Contributor

    Hi, we will be migrating from opencensus to opentelemetry soon. At that point we will expose the builtin metrics namespace and allow end users to export the builtin metrics to other destinations. Would that address your usecase? or do you still need the ability to integrate deeper in the stack?

  9. rravi-sift commented on Aug 8, 2023

    @rravi-sift

    Hi @igorbernstein2,

    We chose OpenCensus over the built-in metrics primarily because the latter doesn't allow us to modify metric tags. Specifically, we're keen on tagging metrics with the client's zone and hostname, which is achievable with OpenCensus.

    I have a couple of queries regarding this:

    1. If the library transitions to OpenTelemetry, would it simplify the process of customizing or adding new tags? If not, we would not benefit from the migration
    2. We are currently blocked on this issue because we have Bigtable instances with hundreds of tables; hence, the current OpenCensus metric does not paint a good picture. Do you know the ETA for migration?

    Thanks for your assistance.

  10. igorbernstein2 commented on Aug 10, 2023

    @igorbernstein2
    Contributor

    tldr: yes opentelemetry will make it easy to export metrics that have static labels like the zone & hostname.

    Longer answer:

    For built-in metrics, we have to aggregate away the client resource labels (hostname, pid, etc) due to an explosion of cardinality. This is the reason why the hostname is not preserved for builtin metrics. In addition, built-in metrics are the only metrics that the bigtable service will collect for free. So we need a private exporter. When implementing built-in metrics, opentelemetry wasnt quite ready, so we implemented it using OpenCensus. This created an issue for us where OpenCensus only has a single global namespace, which prevents us from selectively exporting built-in exports to bigtable service and conversely, it pollutes existing OpenCensus integrations. So we ended up shading & relocating the OpenCensus to achieve a private namespace. Unfortunately having this private namespace prevents you from attaching your own exporter with static tags.

    The previous iteration of metrics (the ones that lack table id), uses the global namespace and thus allows you to attach any exporter that you would like. Unfortunately as discussed earlier in this issue, that implementation is currently missing table ids. Unfortunately there is no easy way to add another dimension to existing views without breaking existing applications.

    In the current state, the only integration path for custom static labels & table ids is to fork MetricsTracer (by extending BigtableTracer) and define your own meters and integrate with Opentelemetry or OpenCensus.

    In the near term we will migrate the BuiltinMetrics to use Opentelemetry which has the ability to define namespaces w/o resorting to shading. This will give endusers access to the builtin metrics namespace and register their own exporters. These exporters can define arbitrary static labels like hostname. Which I believe will address your usecase. In terms of timing, this work has started and their are a couple of outstanding PRs for the migration that need to be landed. So I suspect it will be ready this quarter.

  11. robwil commented on Oct 16, 2024

    @robwil

    I wanted to ask what the status of this one is, given that the OpenTelemetry support (googleapis/java-bigtable#2166) has been added. Is there a way now to add tableId? As far as I can tell, the latest code has tableId available in attributes that are used by BuiltinMetricsTracer, but this is only used for aggregated metrics views, not for individual traces (which still relies on OpencensusTracer - which still seems to rely on baseAttributes where it's not easy to get tableId).

  12. changed the title [-]add bigtable_table_id attribute to opencensus stats / traces[/-] [+][java-bigtable] add bigtable_table_id attribute to opencensus stats / traces[/+] on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigtableIssues related to the Bigtable API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions