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

Azure AppInsights Monitoring using Open telemetry #475

Closed
wants to merge 3 commits into from

Conversation

vrajroutu
Copy link

@vrajroutu vrajroutu commented Jul 28, 2023

Purpose

  • ...
  • Extend the functionality of the repository by adding a new function.
  • Enable the sending of monitoring metrics to Azure Application Insights.
  • Facilitate monitoring and analysis of requests to Cognitive Search and OpenAI services.
  • Utilize OpenTelemetry as the mechanism to enable monitoring capabilities.

Does this introduce a breaking change?

[ ] Yes
[X ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
  • provision app-insights
  • update app-service --> configuration --> env-variables --> AZURE_MONITOR_CONNECTION_STRING
  • azd deploy
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

top = overrides.get("top") or 3
exclude_category = overrides.get("exclude_category") or None
filter = "category ne '{}'".format(exclude_category.replace("'", "''")) if exclude_category else None
with tracer.start_as_current_span("ChatReadRetrieveReadApproach.run"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there an approach that doesnt require adding "with tracer" to each of these functions? Ideally, we could just attach middleware to the routes.


from core.messagebuilder import MessageBuilder
from core.modelhelper import get_token_limit

AZURE_MONITOR_CONNECTION_STRING = os.environ.get("AZURE_MONITOR_CONNECTION_STRING") or ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please set AZURE_MONITOR_CONNECTION_STRING in infra/main.bicep

@pamelafox
Copy link
Collaborator

Thanks @vrajroutu, we ended up going with Anthony's PR for this one: #515
But thanks for getting the ball rolling! Closing this now.

@pamelafox pamelafox closed this Aug 16, 2023
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

Successfully merging this pull request may close these issues.

2 participants