The main data source abstraction interface, represents an instance of a data source
Although this is a class, datasource implementations do not \*yet\* need to extend it. As such, we can not yet add functions with default implementations.
<b>Signature</b>
```typescript
export declare abstract class DataSourceApi<TQueryextendsDataQuery =DataQuery,TOptionsextendsDataSourceJsonData =DataSourceJsonData>
```
<b>Import</b>
```typescript
import { DataSourceApi } from '@grafana/data';
```
<b>Constructors</b>
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [constructor(instanceSettings)](#constructor-instancesettings) | | Constructs a new instance of the <code>DataSourceApi</code> class |
<b>Properties</b>
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [components](#components-property) | | <code>DataSourcePluginComponents<DataSourceApi<TQuery, TOptions>, TQuery, TOptions></code> | Set after constructor call, as the data source instance is the most common thing to pass around we attach the components to this instance for easy access |
| [getLogRowContext](#getlogrowcontext-property) | | <code><TContextQueryOptions extends {}>(row: LogRowModel, options?: TContextQueryOptions) => Promise<DataQueryResponse></code> | Retrieve context for a given log row |
| [id](#id-property) | | <code>number</code> | Set in constructor |
| [init](#init-property) | | <code>() => void</code> | Initializes a datasource after instantiation |
| [interval](#interval-property) | | <code>string</code> | min interval range |
| [languageProvider](#languageprovider-property) | | <code>any</code> | Used in explore |
| [meta](#meta-property) | | <code>DataSourcePluginMeta</code> | static information about the datasource |
| [name](#name-property) | | <code>string</code> | Set in constructor |
<b>Methods</b>
| Method | Modifiers | Description |
| --- | --- | --- |
| [annotationQuery(options)](#annotationquery-method) | | Can be optionally implemented to allow datasource to be a source of annotations for dashboard. To be visible in the annotation editor <code>annotations</code> capability also needs to be enabled in plugin.json. |
| [getHighlighterExpression(query)](#gethighlighterexpression-method) | | Used in explore |
| [getQueryDisplayText(query)](#getquerydisplaytext-method) | | Convert a query to a simple text string |
| [getQueryHints(query, results, rest)](#getqueryhints-method) | | Get hints for query improvements |
| [getTagKeys(options)](#gettagkeys-method) | | Get tag keys for adhoc filters |
| [getTagValues(options)](#gettagvalues-method) | | Get tag values for adhoc filters |
Set after constructor call, as the data source instance is the most common thing to pass around we attach the components to this instance for easy access
Can be optionally implemented to allow datasource to be a source of annotations for dashboard. To be visible in the annotation editor `annotations` capability also needs to be enabled in plugin.json.