Skip to content

Commit

Permalink
Rename to Amazon Managed Service for Prometheus Data Source (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
njvrzm authored Jul 16, 2024
1 parent 9ca57e6 commit e02ba84
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 42 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.3.0
- Rename plugin & repo

## 0.2.0 (Private release for testing)
- Initial private release of the Amazon Managed Prometheus plugin, a wrapper around [the core Prometheus datasource](https://grafana.com/docs/grafana/latest/datasources/prometheus/) that uses Amazon-specific authentication.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prometheus Amazon Data Source
# Amazon Managed Service for Prometheus Data Source

This data source plugin is is for Amazon Prometheus. It has all the features of the Grafana core Prometheus plugin with Amazon specific authentication in the configuration page.
This data source plugin is for the Amazon Managed Service for Prometheus. It has all the features of the Grafana core Prometheus plugin with Amazon specific authentication in the configuration page.

Amazon Managed Service for Prometheus is a Prometheus-compatible service that monitors and provides alerts on containerized applications and infrastructure at scale.

Expand Down
2 changes: 1 addition & 1 deletion cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"grafana",
"datasource",
"datasources",
"prometheusamazon",
"amazonprometheus",
"tsdb",
"promlib",
"instancemgmt",
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
grafana:
user: root
container_name: 'grafana-prometheusamazon-datasource'
container_name: 'grafana-amazonprometheus-datasource'
platform: linux/amd64

depends_on:
Expand All @@ -36,6 +36,6 @@ services:
cap_add:
- SYS_PTRACE
volumes:
- ./dist:/var/lib/grafana/plugins/grafana-prometheusamazon-datasource
- ./dist:/var/lib/grafana/plugins/grafana-amazonprometheus-datasource
- ./provisioning:/etc/grafana/provisioning
- .:/root/grafana-prometheusamazon-datasource
- .:/root/grafana-amazonprometheus-datasource
2 changes: 1 addition & 1 deletion e2e/annotation-editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.describe('Prometheus annotation query editor', () => {

await page.getByTestId('data-testid Select a data source').fill(ds.name);

await page.getByRole('button', { name: `${ds.name} Prometheus` }).click();
await page.getByRole('button', { name: `${ds.name}` }).click();

await expect(annotationEditPage
.getByGrafanaSelector(selectors.components.DataSource.Prometheus.queryEditor.code.queryField)).toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions e2e/configuration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ test.describe('Configuration tests', () => {
page,
}) => {
const configPage = await createDataSourceConfigPage({
type: "grafana-prometheusamazon-datasource",
type: "grafana-amazonprometheus-datasource",
name: DATA_SOURCE_NAME,
});

Expand Down Expand Up @@ -136,7 +136,7 @@ test.describe('Configuration tests', () => {
page,
}) => {
const configPage = await createDataSourceConfigPage({
type: "grafana-prometheusamazon-datasource",
type: "grafana-amazonprometheus-datasource",
name: DATA_SOURCE_NAME + "check",
});

Expand Down
20 changes: 10 additions & 10 deletions e2e/query-editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ test.describe('Prometheus query editor', () => {

await page.getByTestId('data-testid Select a data source').click();

await page.getByTestId('data-testid Select a data source').fill('Prometheus-amazon');
await page.getByTestId('data-testid Select a data source').fill('Amazon Managed Service for Prometheus');

await page.getByRole('button', { name: 'Prometheus-amazon Prometheus' }).click();
await page.getByRole('button', { name: 'Amazon Managed Service for Prometheus' }).click();

await explorePage
.getByGrafanaSelector(selectors.components.DataSource.Prometheus.queryEditor.builder.metricSelect).isVisible();
Expand Down Expand Up @@ -226,9 +226,9 @@ test.describe('Prometheus query editor', () => {

await page.getByTestId('data-testid Select a data source').click();

await page.getByTestId('data-testid Select a data source').fill('Prometheus-amazon');
await page.getByTestId('data-testid Select a data source').fill('Amazon Managed Service for Prometheus');

await page.getByRole('button', { name: 'Prometheus-amazon Prometheus' }).click();
await page.getByRole('button', { name: 'Amazon Managed Service for Prometheus' }).click();

await explorePage
.getByGrafanaSelector(selectors.components.DataSource.Prometheus.queryEditor.builder.metricSelect).isEnabled();
Expand Down Expand Up @@ -271,9 +271,9 @@ test.describe('Prometheus query editor', () => {

await page.getByTestId('data-testid Select a data source').click();

await page.getByTestId('data-testid Select a data source').fill('Prometheus-amazon');
await page.getByTestId('data-testid Select a data source').fill('Amazon Managed Service for Prometheus');

await page.getByRole('button', { name: 'Prometheus-amazon Prometheus' }).click();
await page.getByRole('button', { name: 'Amazon Managed Service for Prometheus' }).click();

await explorePage
.getByGrafanaSelector(selectors.components.DataSource.Prometheus.queryEditor.builder.metricSelect).isVisible();
Expand Down Expand Up @@ -306,9 +306,9 @@ test.describe('Prometheus query editor', () => {

await page.getByTestId('data-testid Select a data source').click();

await page.getByTestId('data-testid Select a data source').fill('Prometheus-amazon');
await page.getByTestId('data-testid Select a data source').fill('Amazon Managed Service for Prometheus');

await page.getByRole('button', { name: 'Prometheus-amazon Prometheus' }).click();
await page.getByRole('button', { name: 'Amazon Managed Service for Prometheus' }).click();

await explorePage
.getByGrafanaSelector(selectors.components.QueryBuilder.labelSelect).isVisible();
Expand Down Expand Up @@ -343,9 +343,9 @@ test.describe('Prometheus query editor', () => {

await page.getByTestId('data-testid Select a data source').click();

await page.getByTestId('data-testid Select a data source').fill('Prometheus-amazon');
await page.getByTestId('data-testid Select a data source').fill('Amazon Managed Service for Prometheus');

await page.getByRole('button', { name: 'Prometheus-amazon Prometheus' }).click();
await page.getByRole('button', { name: 'Amazon Managed Service for Prometheus' }).click();

await explorePage
.getByGrafanaSelector(selectors.components.DataSource.Prometheus.queryEditor.builder.metricSelect).isVisible();
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/grafana/prometheus-amazon
module github.com/grafana/grafana-amazonprometheus-datasource

go 1.22.4

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grafana-prometheusamazon-datasource",
"version": "0.2.0",
"name": "grafana-amazonprometheus-datasource",
"version": "0.3.0",
"description": "A plugin for Amazon Managed Prometheus",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
Expand Down
2 changes: 1 addition & 1 deletion pkg/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

func NewDatasource(ctx context.Context, dsInstanceSettings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
plog := backend.NewLoggerWith("logger", "tsdb.prometheus-amazon")
plog := backend.NewLoggerWith("logger", "tsdb.amazon-prometheus")
plog.Debug("Initializing")

authSettings, _ := awsds.ReadAuthSettingsFromContext(ctx)
Expand Down
2 changes: 1 addition & 1 deletion pkg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
// from Grafana to create different instances of SampleDatasource (per datasource
// ID). When datasource configuration changed Dispose method will be called and
// new datasource instance created using NewSampleDatasource factory.
if err := datasource.Manage("grafana-prometheusamazon-datasource", NewDatasource, datasource.ManageOpts{}); err != nil {
if err := datasource.Manage("grafana-amazonprometheus-datasource", NewDatasource, datasource.ManageOpts{}); err != nil {
log.DefaultLogger.Error(err.Error())
os.Exit(1)
}
Expand Down
16 changes: 8 additions & 8 deletions provisioning/dashboards/e2e-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
{
"datasource": {
"type": "grafana-prometheusamazon-datasource",
"uid": "grafana-prometheusamazon"
"type": "grafana-amazonprometheus-datasource",
"uid": "grafana-amazonprometheus"
},
"enable": true,
"expr": "go_goroutines",
Expand All @@ -38,8 +38,8 @@
"panels": [
{
"datasource": {
"type": "grafana-prometheusamazon-datasource",
"uid": "grafana-prometheusamazon"
"type": "grafana-amazonprometheus-datasource",
"uid": "grafana-amazonprometheus"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -119,7 +119,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "grafana-prometheusamazon"
"uid": "grafana-amazonprometheus"
},
"disableTextWrap": false,
"editorMode": "builder",
Expand Down Expand Up @@ -149,8 +149,8 @@
"value": "__name__"
},
"datasource": {
"type": "grafana-prometheusamazon-datasource",
"uid": "grafana-prometheusamazon"
"type": "grafana-amazonprometheus-datasource",
"uid": "grafana-amazonprometheus"
},
"definition": "label_names()",
"hide": 0,
Expand Down Expand Up @@ -178,7 +178,7 @@
"timeRangeUpdatedDuringEditOrView": false,
"timepicker": {},
"timezone": "browser",
"title": "grafana-prometheusamazon",
"title": "grafana-amazonprometheus",
"uid": "fdewz0hu7qccge",
"version": 2,
"weekStart": ""
Expand Down
2 changes: 1 addition & 1 deletion provisioning/datasources/code-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: 1
datasources:
- name: a-prometheus-code-editor
uid: a-prometheus-code-editor
type: grafana-prometheusamazon-datasource
type: grafana-amazonprometheus-datasource
url: http://prometheus:9090
access: proxy
editable: true
Expand Down
6 changes: 3 additions & 3 deletions provisioning/datasources/datasources.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus-amazon
uid: grafana-prometheusamazon
type: grafana-prometheusamazon-datasource
- name: Amazon Managed Service for Prometheus
uid: grafana-amazonprometheus
type: grafana-amazonprometheus-datasource
url: http://prometheus:9090
access: proxy
editable: true
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Prometheus Amazon Data Source
# Amazon Managed Service for Prometheus Data Source

Amazon Managed Service for Prometheus is a Prometheus-compatible service that monitors and provides alerts on containerized applications and infrastructure at scale.

Expand Down
6 changes: 4 additions & 2 deletions src/configuration/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ export const ConfigEditor = (props: Props) => {
<>
{options.access === 'direct' && (
<Alert title="Error" severity="error">
Browser access mode in the Prometheus data source is no longer available. Switch to server access mode.
Browser access mode in the Amazon Managed Service for Prometheus data source is no longer available. Switch to server access mode.
</Alert>
)}
<DataSourceDescription
dataSourceName="Prometheus"
dataSourceName="Amazon Managed Service for Prometheus"
// TODO: point this at the new plugin's docs or README }
docsLink="https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/"
/>
<hr className={`${styles.hrTopSpace} ${styles.hrBottomSpace}`} />
Expand Down Expand Up @@ -60,6 +61,7 @@ export const ConfigEditor = (props: Props) => {
* @returns
*/
export function docsTip(url?: string) {
/* TODO: point this at the new plugin's docs or README */
const docsUrl = 'https://grafana.com/docs/grafana/latest/datasources/prometheus/#configure-the-data-source';

return (
Expand Down
6 changes: 3 additions & 3 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"category": "tsdb",
"$schema": "https://raw.githubusercontent.com/grafana/grafana/main/docs/sources/developers/plugins/plugin.schema.json",
"type": "datasource",
"name": "Prometheus Amazon",
"id": "grafana-prometheusamazon-datasource",
"executable": "gpx_prometheus_amazon",
"name": "Amazon Managed Service for Prometheus",
"id": "grafana-amazonprometheus-datasource",
"executable": "gpx_amazonprometheus",
"routes": [
{
"method": "POST",
Expand Down

0 comments on commit e02ba84

Please sign in to comment.