Skip to content

Conversation

@gregorycrist
Copy link

Updated the authorization header to use secrets for API key.

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, or chat mode file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, or chat mode with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New chat mode file.
  • New collection file.
  • Update to existing instruction, prompt, chat mode, or collection.
  • Other (please specify):

Additional Notes


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Updated the authorization header to use secrets for API key.
Copilot AI review requested due to automatic review settings November 19, 2025 01:21
Copilot finished reviewing on behalf of gregorycrist November 19, 2025 01:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR attempts to change the authorization configuration in the Elasticsearch observability agent from using an environment variable approach to embedding the API key directly in the header argument. However, the implementation uses incorrect syntax for agent configuration files.

Key Issues:

  • Uses GitHub Actions workflow syntax (${{ secrets.ELASTIC_API_KEY }}) which is not appropriate for agent configuration files
  • Comments out the env section which was the correct approach for managing secrets
  • Leaves outdated documentation comments in place

'https://{KIBANA_URL}/api/agent_builder/mcp',
'--header',
'Authorization:${AUTH_HEADER}'
'Authorization: ApiKey ${{ secrets.ELASTIC_API_KEY }}'
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The syntax ${{ secrets.ELASTIC_API_KEY }} is GitHub Actions workflow syntax and should not be used in agent configuration files. Agent files use environment variable references instead.

The correct approach is to keep the original env section and reference the environment variable in the header. For example:

args: [
  'mcp-remote',
  'https://{KIBANA_URL}/api/agent_builder/mcp',
  '--header',
  'Authorization:${AUTH_HEADER}'
]
env:
  AUTH_HEADER: ApiKey ${{ secrets.ELASTIC_API_KEY }}

Or if you want to use a more direct approach similar to other agents in this repo, use:

args: [
  'mcp-remote',
  'https://{KIBANA_URL}/api/agent_builder/mcp',
  '--header',
  'Authorization: ApiKey ${ELASTIC_API_KEY}'
]
env:
  ELASTIC_API_KEY: ${{ secrets.ELASTIC_API_KEY }}

See dynatrace-expert.agent.md (line 8) and newrelic-deployment-observability.agent.md (line 12) for examples of the correct environment variable reference pattern.

Copilot uses AI. Check for mistakes.
'Authorization: ApiKey ${{ secrets.ELASTIC_API_KEY }}'
]
# This section maps a GitHub secret to the AUTH_HEADER environment variable
# The 'ApiKey' prefix is required by Elastic
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

This comment is now outdated since the env section has been commented out. If the env section is no longer used, this comment should be removed or updated to reflect the new configuration approach.

Suggested change
# The 'ApiKey' prefix is required by Elastic

Copilot uses AI. Check for mistakes.
@aaronpowell aaronpowell merged commit 656988b into github:update-contributors Nov 21, 2025
6 checks passed
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