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

[APM] Service icons metadata endpoint doesn't apply environment filter #175662

Open
kpatticha opened this issue Jan 26, 2024 · 4 comments
Open

[APM] Service icons metadata endpoint doesn't apply environment filter #175662

kpatticha opened this issue Jan 26, 2024 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience good first issue low hanging fruit stale Used to mark issues that were closed for being stale Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team

Comments

@kpatticha
Copy link
Contributor

kpatticha commented Jan 26, 2024

We didn't consider the case where each environment could use different cloud provider or platform.

const serviceMetadataIconsRoute = createApmServerRoute({
endpoint: 'GET /internal/apm/services/{serviceName}/metadata/icons',
params: t.type({
path: t.type({ serviceName: t.string }),
query: rangeRt,
}),
options: { tags: ['access:apm'] },
handler: async (resources): Promise<ServiceMetadataIcons> => {
const apmEventClient = await getApmEventClient(resources);
const { params, config } = resources;
const { serviceName } = params.path;
const { start, end } = params.query;
const searchAggregatedTransactions = await getSearchTransactionsEvents({
apmEventClient,
config,
start,
end,
kuery: '',
});
return getServiceMetadataIcons({
serviceName,
apmEventClient,
searchAggregatedTransactions,
start,
end,
});
},
});

@botelastic botelastic bot added the needs-team Issues missing a team label label Jan 26, 2024
@jsanz jsanz added the Team:APM All issues that need APM UI Team support label Jan 30, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 30, 2024
@neptunian neptunian added Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team and removed Team:APM All issues that need APM UI Team support labels Feb 1, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@neptunian neptunian added the bug Fixes for quality problems that affect the customer experience label Feb 1, 2024
@neptunian
Copy link
Contributor

neptunian commented Feb 1, 2024

@kpatticha Since the query only returns one document, I think that could be the problem where no value is returned. I tried querying my edge cluster data and was able to get documents that have no values:

GET /metrics-apm*,apm-*,logs-apm*/_search
{
  "size": 10,
  "query": {
    "bool": {
      "must_not": [
        {
          "exists": {
            "field": "cloud.provider"
          }
        }
      ],
      "filter": [
        {
          "term": {
            "service.name": "heartbeat"
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": "now-15m/m",
              "lte": "now"
            }
          }
        }
      ]
    }
  },
  "aggs": {
    "by_environment": {
      "terms": {
        "field": "service.environment",
        "size": 10
      },
      "aggs": {
        "missing_cloud_provider_count": {
          "missing": {
            "field": "cloud.provider"
          }
        }
      }
    }
  }
}

It seems like it could be possible that no value is returned for cloud.provider if it falls out of the time range or the highest ranked document doesn't include this field because it includes the other fields.

@smith smith added the good first issue low hanging fruit label Jul 10, 2024
@botelastic
Copy link

botelastic bot commented Jan 6, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the stale Used to mark issues that were closed for being stale label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience good first issue low hanging fruit stale Used to mark issues that were closed for being stale Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

No branches or pull requests

5 participants