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

[APM] Add apm_core plugin and query errors, spans, transactions from separate indices #21022

Merged
merged 6 commits into from
Jul 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename to apm_oss
  • Loading branch information
sorenlouv committed Jul 23, 2018
commit 9a0578cbae3bc0045e6f782bb355a8bf8b727521
Original file line number Diff line number Diff line change
@@ -17,9 +17,9 @@
* under the License.
*/

export default function apmCore(kibana) {
export default function apmOss(kibana) {
return new kibana.Plugin({
id: 'apm_core',
id: 'apm_oss',

config(Joi) {
return Joi.object({
@@ -31,7 +31,7 @@ export default function apmCore(kibana) {

// ES Indices
errorIndices: Joi.string().default('apm-*-error-*'),
onboardingIndices: Joi.string().default('apm-*'), // TODO: change to "apm-*-onboarding-*" when APM-Server is ready
onboardingIndices: Joi.string().default('apm-*-onboarding-*'),
spanIndices: Joi.string().default('apm-*-span-*'),
transactionIndices: Joi.string().default('apm-*-transaction-*'),
}).default();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "apm_core",
"name": "apm_oss",
"version": "kibana"
}
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/server/tutorials/apm/index.js
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ function isEnabled(config) {

export function apmSpecProvider(server) {
const config = server.config();
const apmIndexPattern = config.get('apm_core.indexPattern');
const apmIndexPattern = config.get('apm_oss.indexPattern');

const artifacts = {
dashboards: [
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ import { getSavedObjects } from './get_saved_objects';

const indexPatternTitle = 'dynamic index pattern title';

test('should dynamically set index title to "apm_core.indexPattern" yaml config value', () => {
test('should dynamically set index title to "apm_oss.indexPattern" yaml config value', () => {
const savedObjects = getSavedObjects(indexPatternTitle);
const indexPattern = savedObjects[0];
expect(indexPattern.type).to.be('index-pattern');
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/index.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import { initStatusApi } from './server/routes/status_check';

export function apm(kibana) {
return new kibana.Plugin({
require: ['kibana', 'elasticsearch', 'xpack_main', 'apm_core'],
require: ['kibana', 'elasticsearch', 'xpack_main', 'apm_oss'],
id: 'apm',
configPrefix: 'xpack.apm',
publicDir: resolve(__dirname, 'public'),
@@ -30,7 +30,7 @@ export function apm(kibana) {
return {
mlEnabled: config.get('xpack.ml.enabled'),
apmUiEnabled: config.get('xpack.apm.ui.enabled'),
apmIndexPattern: config.get('apm_core.indexPattern')
apmIndexPattern: config.get('apm_oss.indexPattern')
};
},
hacks: ['plugins/apm/hacks/toggle_app_link_in_nav']
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ export async function getBuckets({ serviceName, groupId, bucketSize, setup }) {
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.errorIndices'),
index: config.get('apm_oss.errorIndices'),
body: {
size: 0,
query: {
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/errors/get_error_group.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export async function getErrorGroup({ serviceName, groupId, setup }) {
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.errorIndices'),
index: config.get('apm_oss.errorIndices'),
body: {
size: 1,
query: {
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/errors/get_error_groups.js
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export async function getErrorGroups({
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.errorIndices'),
index: config.get('apm_oss.errorIndices'),
body: {
size: 0,
query: {
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/lib/services/get_service.js
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ export async function getService({ serviceName, setup }) {

const params = {
index: [
config.get('apm_core.errorIndices'),
config.get('apm_core.transactionIndices')
config.get('apm_oss.errorIndices'),
config.get('apm_oss.transactionIndices')
],
body: {
size: 0,
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/lib/services/get_services.js
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@ export async function getServices({ setup }) {

const params = {
index: [
config.get('apm_core.errorIndices'),
config.get('apm_core.transactionIndices')
config.get('apm_oss.errorIndices'),
config.get('apm_oss.transactionIndices')
],
body: {
size: 0,
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/lib/status_check/agent_check.js
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ export async function getAgentStatus({ setup }) {

const params = {
index: [
config.get('apm_core.errorIndices'),
config.get('apm_core.transactionIndices')
config.get('apm_oss.errorIndices'),
config.get('apm_oss.transactionIndices')
],
body: {
size: 0,
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/status_check/server_check.js
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ export async function getServerStatus({ setup }) {
const { client, config } = setup;

const params = {
index: config.get('apm_core.onboardingIndices'),
index: config.get('apm_oss.onboardingIndices'),
body: {
size: 0,
query: {
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ export async function getTimeseriesData({
const { intervalString, bucketSize } = getBucketSize(start, end, 'auto');

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 0,
query: {
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ export async function calculateBucketSize({
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 0,
query: {
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ export async function getBuckets({
const bucketTargetCount = config.get('xpack.apm.bucketTargetCount');

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 0,
query: {
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ export async function getTopTransactions({
const minutes = duration.asMinutes();

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 0,
query: {
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ async function getTransaction({ transactionId, setup }) {
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 1,
query: {
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export async function getTransactionDuration({ transactionId, setup }) {
const { start, end, esFilterQuery, client, config } = setup;

const params = {
index: config.get('apm_core.transactionIndices'),
index: config.get('apm_oss.transactionIndices'),
body: {
size: 1,
_source: TRANSACTION_DURATION,
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ async function getSpans({ transactionId, setup }) {
const { start, end, client, config } = setup;

const params = {
index: config.get('apm_core.spanIndices'),
index: config.get('apm_oss.spanIndices'),
body: {
size: 500,
query: {