Skip to content

Commit

Permalink
docs: update spelling of datasource to data source
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgerstmayr committed Jun 30, 2022
1 parent a0768f0 commit 057fa1d
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 50 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Due to a breaking change (see section below), the following instructions are req
- **all**: rename plugin IDs from `pcp-*-*` to `performancecopilot-*-*`
- **all**: remove `window.setGrafanaPcpLogLevel()` debug function
- **chore**: remove deprecated `dependencies.grafanaVersion` field from plugin metadata
- **docs**: update spelling of datasource to data source

### Breaking Changes
- the internal plugin IDs of the data source and panel plugins were renamed from `pcp-X-Y` to `performancecopilot-X-Y`, for example `pcp-redis-datasource` was renamed to `performancecopilot-redis-datasource` in order to conform to the Grafana plugin id naming conventions
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deps: deps-dashboards deps-frontend deps-backend ## Install all dependencies

##@ Development

dev-frontend: deps-frontend ## Build frontend datasources (development)
dev-frontend: deps-frontend ## Build frontend data sources (development)
yarn run dev

watch-frontend: deps-frontend build-dashboards ## Auto rebuilt frontend on file changes
Expand All @@ -38,7 +38,7 @@ watch-frontend: deps-frontend build-dashboards ## Auto rebuilt frontend on file
dev-backend: deps-backend
go build -race -o ./dist/datasources/redis/pcp_redis_datasource_$$(go env GOOS)_$$(go env GOARCH) -tags netgo -ldflags -w ./pkg

restart-backend: ## Rebuild and restart backend datasource (as root)
restart-backend: ## Rebuild and restart backend data source (as root)
sudo -u "$$(stat -c '%U' .)" make dev-backend
killall pcp_redis_datasource_$$(go env GOOS)_$$(go env GOARCH)

Expand All @@ -51,14 +51,14 @@ dist/%.json: src/%.jsonnet $(JSONNET_VENDOR_DIR)

build-dashboards: $(shell find src -name '*.jsonnet' | sed -E 's@src/(.+)\.jsonnet@dist/\1.json@g') ## Build Grafana dashboards from jsonnet

build-frontend: deps-frontend ## Build frontend datasources
build-frontend: deps-frontend ## Build frontend data sources
yarn run build

# check for javascript greater than 1 MB
test $$(find dist/ -name '*.js' -size +1024k | wc -l) -eq 1 || exit 1

GO_LD_FLAGS := -w -s -extldflags "-static"
build-backend: deps-backend ## Build backend datasource
build-backend: deps-backend ## Build backend data source
#mage buildAll
for arch in amd64 arm arm64 s390x ppc64le 386; do \
CGO_ENABLED=0 GOOS=linux GOARCH=$${arch} go build -o dist/datasources/redis/pcp_redis_datasource_linux_$${arch} -ldflags '$(GO_LD_FLAGS)' ./pkg; \
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2019 Netflix
Copyright (c) 2019-2021 Grafana Labs
Copyright (c) 2019-2021 Red Hat

Thanks to Jason Koch for the initial pcp-live datasource implementation and the host overview dashboard.
The Linux BPF Pony (used for the bpftrace datasource) was created by Deirdré Straughan using General Zoi's pony creator.
Thanks to Jason Koch for the initial pcp-live data source implementation and the host overview dashboard.
The Linux BPF Pony (used for the bpftrace data source) was created by Deirdré Straughan using General Zoi's pony creator.
The flamegraph panel uses d3-flame-graph, Copyright (c) 2018 Martin Spier.
The bpftrace documentation follows the [Reference Guide](https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md), written by bpftrace community contributors.
2 changes: 1 addition & 1 deletion cypress/integration/checklist.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('PCP Vector Checklist', () => {
cy.task('grafana:reset');
cy.login();
cy.enablePlugin();
cy.addDatasource('performancecopilot-vector-datasource', 'PCP Vector datasource');
cy.addDatasource('performancecopilot-vector-datasource', 'PCP Vector data source');
});

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/datasources/redis.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe('PCP Redis datasource', () => {
describe('PCP Redis data source', () => {
before(() => {
cy.task('grafana:reset');
cy.login();
cy.enablePlugin();
cy.addDatasource('performancecopilot-redis-datasource', 'PCP Redis datasource');
cy.addDatasource('performancecopilot-redis-datasource', 'PCP Redis data source');
});

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/datasources/vector.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
describe('PCP Vector datasource', () => {
describe('PCP Vector data source', () => {
before(() => {
cy.task('grafana:reset');
cy.login();
cy.enablePlugin();
cy.addDatasource('performancecopilot-vector-datasource', 'PCP Vector datasource');
cy.addDatasource('performancecopilot-vector-datasource', 'PCP Vector data source');
});

beforeEach(() => {
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/setup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ describe('grafana-pcp setup', () => {
cy.get('button').should('include.text', 'Disable');
});

it('should setup PCP Redis datasource', () => {
it('should setup PCP Redis data source', () => {
cy.visit('/datasources/new');
cy.contains('PCP Redis').click();
cy.get('input[placeholder="http://localhost:44322"]').type('http://localhost:44322');
cy.get('button[type=submit]').click();
cy.contains('Data source is working');
});

it('should setup PCP Vector datasource', () => {
it('should setup PCP Vector data source', () => {
cy.visit('/datasources/new');
cy.contains('PCP Vector').click();
cy.get('input[placeholder="http://localhost:44322"]').type('http://localhost:44322');
cy.get('button[type=submit]').click();
cy.contains('Data source is working, using Performance Co-Pilot');
});

it('should setup PCP bpftrace datasource', () => {
it('should setup PCP bpftrace data source', () => {
cy.visit('/datasources/new');
cy.contains('PCP bpftrace').click();
cy.get('input[placeholder="http://localhost:44322"]').type('http://localhost:44322');
Expand Down
10 changes: 5 additions & 5 deletions docs/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Dashboards
Performance Co-Pilot metrics can be analyzed with Grafana dashboards, using the **grafana-pcp** plugin.
There are two modes available:

* historical metrics across multiple hosts using the :doc:`datasources/redis` datasource
* live, on-host metrics using the :doc:`datasources/vector` datasource
* historical metrics across multiple hosts using the :doc:`datasources/redis` data source
* live, on-host metrics using the :doc:`datasources/vector` data source

The :doc:`datasources/redis` datasource sends :ref:`pmseries <pmseries-query-language>` queries to **pmproxy**, which in turn queries the redis database for metrics.
The :doc:`datasources/vector` datasource connects to **pmproxy**, which in turn requests live metrics directly from a local or remote **PMCD**.
The :doc:`datasources/redis` data source sends :ref:`pmseries <pmseries-query-language>` queries to **pmproxy**, which in turn queries the redis database for metrics.
The :doc:`datasources/vector` data source connects to **pmproxy**, which in turn requests live metrics directly from a local or remote **PMCD**.
In this case, metrics are stored temporarily in the browser, and metric values are lost when the browser tab is refreshed.
The :doc:`PCP Redis datasource <datasources/redis>` is required for persistence.
The :doc:`PCP Redis data source <datasources/redis>` is required for persistence.
6 changes: 3 additions & 3 deletions docs/datasources/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ To test if the authentication is set up correctly, execute the following command
$ pminfo -f -h "pcp://127.0.0.1?username=pcptestuser" disk.dev.read
Configuring the Grafana Datasource
----------------------------------
Configuring the Grafana Data source
-----------------------------------

Go to the Grafana datasource settings, enable **Basic auth**, and enter the username and password.
Go to the Grafana data source settings, enable **Basic auth**, and enter the username and password.
Click the *Save & Test* button to check if the authentication is working.

.. note::
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ grafana-pcp includes the following (optional) dashboards:
* PCP Vector: Container Overview (CGroups v1)
* PCP Vector: Container Overview (CGroups v2)

You can import the corresponding dashboard on the :doc:`../datasources/vector` datasource settings page.
You can import the corresponding dashboard on the :doc:`../datasources/vector` data source settings page.

.. note::
grafana-pcp before version 3.0.0 includes a single dashboard called **PCP Vector: Container Overview** which supports CGroups v1 only and is installed by default (i.e. no import is required).
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/multiple-vector-hosts.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Multiple Vector Hosts
=====================

In cloud environments, it is often desired to use the Vector datasource to connect to multiple remote hosts without configuring a new data source for each host.
In cloud environments, it is often desired to use the Vector data source to connect to multiple remote hosts without configuring a new data source for each host.
This guide shows a setup for this use case using `Grafana templates <https://grafana.com/docs/grafana/latest/variables/templates-and-variables/>`_.

Setup the Vector data source
----------------------------

Open the Grafana configuration, go to Data Sources, and add the :doc:`../datasources/vector` datasource.
Open the Grafana configuration, go to Data Sources, and add the :doc:`../datasources/vector` data source.
Leave the URL field empty and select **Access: Browser**.
Click the save button. A red alert will appear, with the text `To use this data source, please configure the URL in the query editor.`

Expand All @@ -30,7 +30,7 @@ Save the new variable, go back to the dashboard, enter a hostname (for example,
Create a new graph
------------------

Add a new graph to the dashboard, select the :doc:`../datasources/vector` datasource, enter a PCP metric name (for example ``disk.dev.read_bytes``) in the big textbox, and enter ``http://$host:44322`` in the URL field.
Add a new graph to the dashboard, select the :doc:`../datasources/vector` data source, enter a PCP metric name (for example ``disk.dev.read_bytes``) in the big textbox, and enter ``http://$host:44322`` in the URL field.
If you haven't already, select the time range to *last 5 minutes* and select the auto-refresh interval (top right corner) to 5 seconds, for example.

Now Grafana connects to ``http://localhost:44322`` for this panel (if you have entered ``localhost`` in the host textbox). By changing the value of the host text box, you can change the remote host.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PCP Redis Grafana grafana-pcp
5.2+ 5+ 8.x 4.x
==== ===== ======= ====================

Note: Redis is only required for the :doc:`datasources/redis` datasource.
Note: Redis is only required for the :doc:`datasources/redis` data source.

Distribution Package
--------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Before using grafana-pcp, you need to configure the data sources.
Open the Grafana configuration, go to Data Sources and add the
:doc:`datasources/redis`,
:doc:`datasources/vector` and/or
:doc:`datasources/bpftrace` datasources.
:doc:`datasources/bpftrace` data sources.

The only required configuration field for each data source is the URL to `pmproxy`_.
In most cases the default URL ``http://localhost:44322`` can be used.
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Common Problems
HTTP Error 502: Bad Gateway, please check the datasource and pmproxy settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**When I try to add a datasource in Grafana, I get the following error:**
**When I try to add a data source in Grafana, I get the following error:**
**"HTTP Error 502: Bad Gateway, please check the datasource and pmproxy settings. To use this data source, please configure the URL in the query editor."**

* check if pmproxy is running: ``systemctl status pmproxy``
Expand Down
2 changes: 1 addition & 1 deletion pkg/datasources/redis/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data"
)

// The PCP Redis datasource executes the following HTTP requests to gather the required data for a time series query:
// The PCP Redis data source executes the following HTTP requests to gather the required data for a time series query:
//
// (1) `/series/query?expr=...` to get a list of series ids
// (2) `/series/metrics?series=...` to get the metric names of each series
Expand Down
4 changes: 2 additions & 2 deletions src/components/appconfig/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AppConfig extends PureComponent<Props> {
This app integrates metrics from Performance Co-Pilot.
<br />
<br />
It includes the following datasources:
It includes the following data sources:
<ul
className={css`
margin-left: 2em;
Expand Down Expand Up @@ -67,7 +67,7 @@ export class AppConfig extends PureComponent<Props> {
color: #10a345;
`}
/>{' '}
Plugin enabled. Please configure the datasources now.
Plugin enabled. Please configure the data sources now.
</div>
)}
<div className="gf-form gf-form-button-row">
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function getDatasourceSettings() {
const redisDatasource = datasources.find((ds: any) => ds.type === redisPluginConfig.id);
if (!redisDatasource) {
throw new GenericError(
`Could not find any PCP Redis datasource. Please create a PCP Redis datasource before using the search feature.`
`Could not find any PCP Redis data source. Please create a PCP Redis data source before using the search feature.`
);
}
return redisDatasource;
Expand Down
2 changes: 1 addition & 1 deletion src/datasources/bpftrace/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class PCPBPFtraceDataSource extends DataSourceBase<BPFtraceQuery, BPFtrac

constructor(readonly instanceSettings: DataSourceInstanceSettings<BPFtraceOptions>) {
super(instanceSettings, Config.defaults, Config.apiTimeoutMs);
log.debug('initializate bpftrace datasource');
log.debug('initializate bpftrace data source');
this.poller = new Poller(this.pmApiService, this.pmSeriesApiService, {
retentionTimeMs: this.retentionTimeMs,
refreshIntervalMs: this.getDashboardRefreshInterval() ?? Config.defaultRefreshIntervalMs,
Expand Down
2 changes: 1 addition & 1 deletion src/datasources/bpftrace/script_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ScriptManager {
if (error instanceof PermissionError) {
throw new GenericError(
"You don't have permission to register bpftrace scripts. " +
'Please check the bpftrace PMDA configuration (bpftrace.conf) and the datasource authentication settings.',
'Please check the bpftrace PMDA configuration (bpftrace.conf) and the data source authentication settings.',
error
);
} else {
Expand Down
12 changes: 6 additions & 6 deletions src/datasources/lib/pmapi/datasource_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { MinimalPmapiQuery, PmapiDefaultOptions, PmapiOptions, PmapiQuery } from
const log = getLogger('datasource_base');

export abstract class DataSourceBase<Q extends MinimalPmapiQuery, O extends PmapiOptions> extends DataSourceApi<Q, O> {
/** URL as specified in the datasource settings page (can be undefined) */
/** URL as specified in the data source settings page (can be undefined) */
url?: string;
/** hostspec as specified in the datasource settings page, or default hostspec */
/** hostspec as specified in the data source settings page, or default hostspec */
hostspec: string;
retentionTimeMs: number;
pmApiService: PmApiService;
Expand Down Expand Up @@ -80,7 +80,7 @@ export abstract class DataSourceBase<Q extends MinimalPmapiQuery, O extends Pmap
// Grafana will send additional x-grafana headers to every request
// when in server mode, which make the CORS request fail
throw new GenericError(
'Please set the access mode to Browser in the datasource settings when using a custom pmproxy URL for this panel.'
'Please set the access mode to Browser in the data source settings when using a custom pmproxy URL for this panel.'
);
}
}
Expand All @@ -90,7 +90,7 @@ export abstract class DataSourceBase<Q extends MinimalPmapiQuery, O extends Pmap
}

// if query is not defined (e.g. it's a dashboard variable query (metricFindQuery))
// or the url/hostspec of it evaluates to a blank string, use the datasource settings
// or the url/hostspec of it evaluates to a blank string, use the data source settings
if (isBlank(url)) {
url = this.url;
}
Expand All @@ -101,12 +101,12 @@ export abstract class DataSourceBase<Q extends MinimalPmapiQuery, O extends Pmap
const orInTheQueryErrorText = query ? ' or in the query editor' : '';
if (isBlank(url)) {
throw new GenericError(
`Please specify a connection URL in the datasource settings${orInTheQueryErrorText}.`
`Please specify a connection URL in the data source settings${orInTheQueryErrorText}.`
);
}
if (isBlank(hostspec)) {
throw new GenericError(
`Please specify a host specification in the datasource settings${orInTheQueryErrorText}.`
`Please specify a host specification in the data source settings${orInTheQueryErrorText}.`
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/datasources/lib/pmapi/poller/poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export class Poller {

cleanInactiveTargets() {
if (!this.state.pageIsVisible) {
// Grafana stops polling the datasource if the page is in the background
// Grafana stops polling the data source if the page is in the background
// therefore do not clean inactive targets in this case
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/datasources/lib/pmapi/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface MinimalPmapiQuery extends DataQuery {

/**
* query filled with all default values and
* url + hostspec set from the panel or datasource settings
* url + hostspec set from the panel or data source settings
*/
export interface PmapiQuery extends MinimalPmapiQuery {
expr: string;
Expand Down
8 changes: 4 additions & 4 deletions src/datasources/vector/DEV_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Why doesn't the Vector datasource use the streaming functionality of Grafana?
- the Vector datasource is not streaming, but polling
- streaming disables the auto-refresh selection, so the refresh rate would be fixed in the datasource settings
- Grafana doesn't implement any metrics cache for streaming datasources, so the same metrics cache as now is required anyway
# Why doesn't the Vector data source use the streaming functionality of Grafana?
- the Vector data source is not streaming, but polling
- streaming disables the auto-refresh selection, so the refresh rate would be fixed in the data source settings
- Grafana doesn't implement any metrics cache for streaming data sources, so the same metrics cache as now is required anyway
- Grafana stops refreshing the dashboard when the tab is in background, i.e. streaming would stop - but polling with a JS timer still works
4 changes: 2 additions & 2 deletions src/datasources/vector/datasource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ describe('PCP Vector: overridden url and hostspec', () => {
setGlobalLogLevel('DEBUG');
});

it('should use non-default hostspec from datasource settings', async () => {
it('should use non-default hostspec from data source settings', async () => {
const instanceSettings = {
url: 'http://settings_host:1234',
jsonData: {
Expand Down Expand Up @@ -595,7 +595,7 @@ describe('PCP Vector: overridden url and hostspec', () => {
`);
});

it('should use datasource url if overwritten url is blank', async () => {
it('should use data source url if overwritten url is blank', async () => {
const instanceSettings = {
url: 'http://settings_host:1234',
jsonData: {
Expand Down
2 changes: 1 addition & 1 deletion src/datasources/vector/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class PCPVectorDataSource extends DataSourceBase<VectorQuery, VectorOptio

constructor(readonly instanceSettings: DataSourceInstanceSettings<VectorOptions>) {
super(instanceSettings, Config.defaults, Config.apiTimeoutMs);
log.debug('initializate Vector datasource');
log.debug('initializate Vector data source');
this.poller = new Poller(this.pmApiService, this.pmSeriesApiService, {
retentionTimeMs: this.retentionTimeMs,
refreshIntervalMs: this.getDashboardRefreshInterval() ?? Config.defaultRefreshIntervalMs,
Expand Down

0 comments on commit 057fa1d

Please sign in to comment.