Skip to content

Commit

Permalink
[Reporting][Serverless] No image reporting warnings in kibana server …
Browse files Browse the repository at this point in the history
…logs for serverless (elastic#169297)

## Summary

This PR removes reporting deprecation log messages in kibana server logs
on serverless environments.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
  • Loading branch information
rshen91 authored Oct 30, 2023
1 parent 75586c8 commit ebae682
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ xpack.canvas.enabled: false
xpack.cloud_integrations.data_migration.enabled: false
data.search.sessions.enabled: false
advanced_settings.enabled: false
xpack.screenshotting.enabled: false

# Disable the browser-side functionality that depends on SecurityCheckupGetStateRoutes
xpack.security.showInsecureClusterWarning: false
Expand Down Expand Up @@ -141,3 +140,8 @@ xpack.task_manager.allow_reading_invalid_state: false

## TaskManager requeue invalid tasks, supports ZDT
xpack.task_manager.requeue_invalid_tasks.enabled: true

# Reporting feature
xpack.screenshotting.enabled: false
xpack.reporting.roles.enabled: false
xpack.reporting.statefulSettings.enabled: false
7 changes: 3 additions & 4 deletions x-pack/plugins/reporting/server/config/create_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ export function createConfig(
ipaddr.isValid(kibanaServerHostname) &&
!sum(ipaddr.parse(kibanaServerHostname).toByteArray())
) {
logger.warn(
`Found 'server.host: "0.0.0.0"' in Kibana configuration. Reporting is not able to use this as the Kibana server hostname.` +
` To enable PNG/PDF Reporting to work, 'xpack.reporting.kibanaServer.hostname: localhost' is automatically set in the configuration.` +
` You can prevent this message by adding 'xpack.reporting.kibanaServer.hostname: localhost' in kibana.yml.`
logger.info(
`Overriding server host address "0.0.0.0" in Reporting runtime config,` +
` using "xpack.reporting.kibanaServer.hostname: localhost".`
);
kibanaServerHostname = 'localhost';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ describe('check deprecations when security is disabled', () => {

expect(await getDeprecationsInfo(context, { reportingCore })).toMatchInlineSnapshot(`Array []`);
});

test('logs no deprecations on serverless', async () => {
reportingCore = await createMockReportingCore(
createMockConfigSchema({ statefulSettings: { enabled: false } })
);
expect(await getDeprecationsInfo(context, { reportingCore })).toMatchInlineSnapshot(`Array []`);
});
});

it('insufficient permissions', async () => {
Expand Down

0 comments on commit ebae682

Please sign in to comment.