Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty group shows up as metric name #8810

Closed
linear bot opened this issue Jun 19, 2024 · 2 comments
Closed

empty group shows up as metric name #8810

linear bot opened this issue Jun 19, 2024 · 2 comments

Comments

@linear
Copy link

linear bot commented Jun 19, 2024

e.g. group by service_name -> "service1", "service2", "Count"

Copy link
Author

linear bot commented Jun 19, 2024

@linear linear bot changed the title empty group shows up as metric title empty group shows up as metric name Jun 19, 2024
Copy link

greptile-apps bot commented Jun 19, 2024

To resolve the issue of empty groups showing up as metric titles, follow these steps:

  1. Locate Metric Title Generation: Identify where metric titles are generated in the codebase. This is likely in the GraphQL models or resolvers.

  2. Modify Title Generation Logic: Update the logic to handle empty groups correctly. For example, in models_gen.go, locate the relevant struct or method responsible for generating metric titles.

  3. Add Conditional Check: Add a conditional check to ensure that empty groups are not included in the metric titles. For instance:

// Example modification in models_gen.go
if group == "" {
    // Handle empty group case
    title = "Unknown Group"
} else {
    title = group
}
  1. Regenerate Code: If using code generation tools like gqlgen, ensure to regenerate the code to apply the changes.

  2. Test Changes: Verify that the changes correctly handle empty groups and do not show them as metric titles.

References

/backend/private-graph/graph/model/models_gen.go
/backend/private-graph/graph/generated/generated.go

Ask Greptile

@linear linear bot closed this as completed Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants