kubecost / cost-analyzer-helm-chart

Kubecost helm chart
http://kubecost.com/install
Apache License 2.0
466 stars 412 forks source link

Network Costs detected as disabled in details.html #1485

Closed srpomeroy closed 1 year ago

srpomeroy commented 2 years ago

Describe the bug Network Costs is enabled. The daemon set is running properly and I see network costs in cost allocation but when I view the details.html page for a resource that has network costs, the network costs card says "Network Traffic allocation not configured."

To Reproduce Steps to reproduce the behavior:

  1. Deploy Kubecost with network costs enabled
  2. In UI, under Cost Allocation, aggregate by Namespace
  3. Click on the details link for a specific namespace
  4. Observe the network cost widget

If I inspect the browser console, I see the following call returns no data: sort_desc(sum(increase(kubecost_pod_network_egress_bytes_total{service!="", namespace="${resourceName}"}[7d])) by (service))

If I modify the query and remove the service!="" filter, I get data back.

Expected behavior See metrics for network costs.

Screenshots

image

Collect logs (please complete the following information):

But this one returns something: query=avg(kubecost_network_internet_egress_cost) Response: {"status":"success","data":{"resultType":"vector","result":[{"metric":{},"value":[1655259724,"0.12"]}]}}

mbolt35 commented 2 years ago

@srpomeroy What's the version of the network-costs image?

mbolt35 commented 2 years ago

The answer to the above will only give us an idea as to why the frontend is failing, but the metrics should be backwards compatible - we simply added a new label for service. It may just be the messaging for this page is off -- Probably should read, "Enable Service Capturing. Learn More" with a link to how to enable. I am looking for those docs right now, will paste here whenever I locate them.

srpomeroy commented 2 years ago

@mbolt35 gcr.io/kubecost1/kubecost-network-costs:v16.0

mbolt35 commented 2 years ago

@srpomeroy Ok, cool. That version does support the service tags, but they're all disabled by default, which is likely why there isn't any data showing up. Looks like we just need to change the wording on that particular page... or specifically run different metrics which do include data for the service-less configurations.

jcharcalla commented 2 years ago

I can confirm the promql behind this does work when you set one of these values (Ex: networkCosts.config.services.amazon-web-services=true ). It's certainly not documented that way, and I'm also not sure if that requires the cloud provider integration to be enabled.

mbolt35 commented 2 years ago

@jcharcalla The added service detection does not require cloud provider integration, as it uses the publicly available endpoint APIs from the providers.

Where is this documented for the frontend features? I do think this is a frontend specific issue.

@dwbrown2 @wolfeaustin Thoughts?

jessegoodier commented 2 years ago

Would it be possible to add Internet Egress Cross Zone
Cross Region Total net

to this card? Happy to file a new issue if it needs to be seperate.

image

wolfeaustin commented 2 years ago

@jcharcalla The added service detection does not require cloud provider integration, as it uses the publicly available endpoint APIs from the providers.

Where is this documented for the frontend features? I do think this is a frontend specific issue.

@dwbrown2 @wolfeaustin Thoughts?

I've got some details/Inspect documentation that I need to push up. I'll get this added.

nealormsbee commented 2 years ago

Adding this to the FE-Team project and assigning @wolfeaustin. @jessegoodier if you don't mind creating a separate enhancement issue for putting more detail into that card, I think it makes sense to track that separately from this ticket.

srpomeroy commented 2 years ago

Docs incoming... https://github.com/kubecost/docs/pull/327

nealormsbee commented 1 year ago

Hey @srpomeroy !

As of v1.99, the messaging on the card is improved. We now differentiate between:

Is that sufficient to close this issue, or is there more we should do? It seems like a few things wound up combined here (showing x-zone / x-region breakdowns, product documentation), and I'm not sure if those are required to close this issue, or tracked elsewhere, etc.

srpomeroy commented 1 year ago

Yes! The new logic/messaging is much clearer. Thanks!