Skip to content

Amazon Bedrock - Add Guardrails dashboard#12332

Merged
agithomas merged 0 commit intoelastic:mainfrom
agithomas:issue-obs-infraobs-1437-add-guardrails-dashboard
Jan 17, 2025
Merged

Amazon Bedrock - Add Guardrails dashboard#12332
agithomas merged 0 commit intoelastic:mainfrom
agithomas:issue-obs-infraobs-1437-add-guardrails-dashboard

Conversation

@agithomas
Copy link
Contributor

@agithomas agithomas commented Jan 13, 2025

  • Enhancement

Proposed commit message

Add dashboards to display Amazon Bedrock Guardrails metrics and logs

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • Dashboard verification after upgrade
  • Add dataset filter data_stream.dataset : "aws_bedrock.guardrails" or data_stream.dataset : "aws_bedrock.invocation" filter
  • Package upgrade test
  • Dashboard links validation.

How to test this PR locally

  • elastic-package build
  • elastic-package stack up -v -d --services package-registry

Related issues

Screenshots

amazon_bedrock_guardrails_overview
amazon_bedrock_guardrails_invocation_details

Added links to the Amazon Bedrock overview dashboard

aws_bedrock_invocation

@agithomas agithomas self-assigned this Jan 13, 2025
@agithomas agithomas added dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:aws_bedrock Amazon Bedrock Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Jan 13, 2025
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@agithomas agithomas marked this pull request as ready for review January 13, 2025 10:32
@agithomas agithomas requested review from a team as code owners January 13, 2025 10:32
@andrewkroh andrewkroh added enhancement New feature or request Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jan 13, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@muthu-mps
Copy link
Contributor

Please find my comments in the dashboard image.
Screenshot 2025-01-13 at 5 10 58 PM

  • Why the datastream.dataset filter includes guardrails or invocation?

@agithomas
Copy link
Contributor Author

Thanks @muthu-mps for the inputs.

The intervened Invocations By Policy Type (Input), The intervened Invocations By Policy Type (Output) is related to the Wordcloud visualisation panel. This is why these panels are aligned near the word cloud panel.

These panels don't have much relationship with the Token Unit count (Input) and The token unit count(Output)

@agithomas
Copy link
Contributor Author

Regarding the feedback on the text - "Text Units utilised by different guardrail policies", we are not only showing the total text unit utilisation by policy type but also the input-output responses, overall sum (without any grouping). These are different dimensions of the same metrics, but related to the guardrail policy.

@agithomas
Copy link
Contributor Author

agithomas commented Jan 13, 2025

Why the datastream.dataset filter includes guardrails or invocation?

The actual request-response involving guardrails is part of the aws_bedrock.invocation ( log-*` dataview) , adding a filter is not possible.

image

Updated the Y-axis label

@muthu-mps
Copy link
Contributor

  • Are we okay with the gap in the middle of the overview dashboard?
Screenshot 2025-01-16 at 6 56 43 PM
  • Guardrails dashboard:
Screenshot 2025-01-16 at 6 58 58 PM
  1. The dashboard filter representation in the overview dashboard and in the guardrails dashboard are different. Can we make this similar in both the places?
  2. Invocations with and without guardrail interventions. Name change suggestion: Invocations by (guardrail interventions vs non-guardrail interventions)
  3. Guardrail Invocations by Content Source. Update the case for content source to make it consistent with the above chart.
  4. Name change suggestion from Number of Invocations where guardrail intervened to Guardrail intervened invocations
  5. Text units Utilized - U should be capitalised.
Screenshot 2025-01-16 at 7 11 01 PM
  1. Same as point 4 above.
  2. Please remove count of text from the name and in the metric label.

@agithomas
Copy link
Contributor Author

Please find my responses below

  1. As mentioned earlier in my previous comment, the same representation is not possible as the filter cannot work on logs-* and metrics-* at the same time.

  2. @daniela-elastic, could you please go through the above suggestions (2-5 , 1 & 2) and advice which among of the above comments is to be considered?

@muthu-mps
Copy link
Contributor

  1. As mentioned earlier in my previous comment, the same representation is not possible as the filter cannot work on logs-* and metrics-* at the same time.

Okay, You mean the UI doesn't allow to save the filter with a custom name if we create more than one filter.

@agithomas
Copy link
Contributor Author

agithomas commented Jan 17, 2025

Okay, You mean the UI doesn't allow to save the filter with a custom name if we create more than one filter.

multi-filters are supported provided the data view is same. But, in this case, we are using two different dataviews - logs-* and metrics-*.

@elasticmachine
Copy link

💚 Build Succeeded

History

  • 💚 Build #20513 succeeded 7766be639b194e1ac4590ccf23a935d6c9c1111d
  • 💚 Build #20492 succeeded 5b87b9799b7a94e88b3465d8038cf5a5f02d44f1
  • 💔 Build #20477 failed d1efc98b2d942e22d8cb432a76e4fdf5e43dcfda
  • 💚 Build #20354 succeeded e2dede5876bdd610d5b5c001ff434ad2cd7d6519
  • 💚 Build #20341 succeeded 4fa584a6409ba2cb4a7be2062cfc2723a59ca886

cc @agithomas

@elastic-sonarqube
Copy link

Copy link
Contributor

@muthu-mps muthu-mps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@agithomas agithomas merged commit 8656951 into elastic:main Jan 17, 2025
@elastic-vault-github-plugin-prod

Package aws_bedrock - 0.21.0 containing this change is available at https://epr.elastic.co/package/aws_bedrock/0.21.0/

@daniela-elastic
Copy link

daniela-elastic commented Jan 20, 2025

Agi please see comments:

  1. "Total Invocations" should be "Total invocations" (small i). See screenshot below

  2. Also, can we consider making the widgets for total invocations, total tokens and total errors slightly narrower, that way there's not too much space between the title of the widget and the number. Alternatively, right justify the number so the beginning of the number is justified with the beginning of the widget name

image
  1. General comment. use small caps in widget names (unless any of the words is a product/service name eg Guardrails; however small caps if the word is a noun that is not the service name, eg guardrail which describes qualitatively what is invoked). See screenshot below

  2. no.1 use "aws_bedrock_guardrails" (the first one), see screenshot below

  3. no.2 change to small caps - "Invocations - with and without guardrail interventions", see screenshot below

  4. no.3 change to small caps - "Guardrail invocations by content source (Input & Output)", see screenshot below

  5. no.4 change to small caps - "Number of invocations where guardrails intervened", see screenshot below

  6. no.5 change to small caps and use singular when a noun is used as an adjective - "Text unit utilization". For the y-axis - "Text units"

  7. Change y-axis to small caps w/ exception of Input/Output - "Guardrail API invocations (Input) / (Output)"

  8. Change to "Text unit utilization"

  9. Change remaining widget names to small caps like above, eg "Invocation latency" instead of "Invocation Latency"

image

@daniela-elastic
Copy link

  1. no.1 Change to small caps - "Number of invocations where the guardrails intervened - by policy type (Input)

  2. no.2 change to "Interventions" - in both widgets

  3. no.2 change to "Text units - by policy type (Input) / (Output)" - in both places accordingly

  4. At top of the section, change "Guardrail policy types of intervened invocations" to "Guardrail policy types for interventions"

image

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
* Amazon Bedrock - Add Guardrails dashboard
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
* Amazon Bedrock - Add Guardrails dashboard
@agithomas agithomas deleted the issue-obs-infraobs-1437-add-guardrails-dashboard branch February 6, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Relates to a Kibana dashboard bug, enhancement, or modification. enhancement New feature or request Integration:aws_bedrock Amazon Bedrock Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants