Skip to content

Commit 9be5b0e

Browse files
Merge branch 'master' into add_comunity_id_processor
2 parents 8497055 + 0b29237 commit 9be5b0e

995 files changed

Lines changed: 23132 additions & 10140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@
249249
#CC# /x-pack/plugins/translations/ @elastic/kibana-localization @elastic/kibana-core
250250

251251
# Security
252-
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
252+
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
253253
/src/plugins/security_oss/ @elastic/kibana-security
254254
/src/plugins/spaces_oss/ @elastic/kibana-security
255255
/src/plugins/user_setup/ @elastic/kibana-security
256256
/test/security_functional/ @elastic/kibana-security
257-
/x-pack/plugins/spaces/ @elastic/kibana-security
258-
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
259-
/x-pack/plugins/security/ @elastic/kibana-security
257+
/x-pack/plugins/spaces/ @elastic/kibana-security
258+
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
259+
/x-pack/plugins/security/ @elastic/kibana-security
260260
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
261261
/x-pack/test/ui_capabilities/ @elastic/kibana-security
262262
/x-pack/test/encrypted_saved_objects_api_integration/ @elastic/kibana-security
@@ -265,6 +265,8 @@
265265
/x-pack/test/security_functional/ @elastic/kibana-security
266266
/x-pack/test/spaces_api_integration/ @elastic/kibana-security
267267
/x-pack/test/saved_object_api_integration/ @elastic/kibana-security
268+
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
269+
/examples/preboot_example/ @elastic/kibana-security @elastic/kibana-core
268270
#CC# /x-pack/plugins/security/ @elastic/kibana-security
269271

270272
# Kibana Alerting Services

docs/apm/api.asciidoc

Lines changed: 239 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Some APM app features are provided via a REST API:
1111
* <<agent-config-api>>
1212
* <<apm-annotation-api>>
1313
* <<kibana-api,Kibana API>>
14+
* <<rum-sourcemap-api>>
1415

1516
[float]
1617
[[apm-api-example]]
@@ -72,6 +73,7 @@ curl -X POST \
7273

7374
////
7475
*******************************************************
76+
*******************************************************
7577
////
7678

7779
[role="xpack"]
@@ -202,11 +204,9 @@ DELETE /api/apm/settings/agent-configuration
202204
*******************************************************
203205
////
204206

205-
206207
[[apm-list-config]]
207208
==== List configuration
208209

209-
210210
[[apm-list-config-req]]
211211
===== Request
212212

@@ -274,7 +274,6 @@ GET /api/apm/settings/agent-configuration
274274
*******************************************************
275275
////
276276

277-
278277
[[apm-search-config]]
279278
==== Search configuration
280279

@@ -472,6 +471,7 @@ curl -X POST \
472471

473472
////
474473
*******************************************************
474+
*******************************************************
475475
////
476476

477477
[[kibana-api]]
@@ -553,3 +553,239 @@ The API returns the following:
553553
// More examples will go here
554554

555555
More information on Kibana's API is available in <<api,REST API>>.
556+
557+
////
558+
*******************************************************
559+
*******************************************************
560+
////
561+
562+
[role="xpack"]
563+
[[rum-sourcemap-api]]
564+
=== RUM source map API
565+
566+
IMPORTANT: This endpoint is only compatible with the
567+
{apm-server-ref}/apm-integration.html[APM integration for Elastic Agent].
568+
Users with a standalone APM Server should instead use the APM Server
569+
{apm-server-ref}/sourcemap-api.html[source map upload API].
570+
571+
A source map allows minified files to be mapped back to original source code --
572+
allowing you to maintain the speed advantage of minified code,
573+
without losing the ability to quickly and easily debug your application.
574+
575+
For best results, uploading source maps should become a part of your deployment procedure,
576+
and not something you only do when you see unhelpful errors.
577+
That’s because uploading source maps after errors happen won’t make old errors magically readable --
578+
errors must occur again for source mapping to occur.
579+
580+
The following APIs are available:
581+
582+
* <<rum-sourcemap-post>>
583+
* <<rum-sourcemap-get>>
584+
* <<rum-sourcemap-delete>>
585+
586+
[float]
587+
[[use-sourcemap-api]]
588+
==== How to use APM APIs
589+
590+
.Expand for required headers, privileges, and usage details
591+
[%collapsible%closed]
592+
======
593+
include::api.asciidoc[tag=using-the-APIs]
594+
======
595+
596+
////
597+
*******************************************************
598+
////
599+
600+
[[rum-sourcemap-post]]
601+
==== Create or update source map
602+
603+
Create or update a source map for a specific service and version.
604+
605+
[[rum-sourcemap-post-privs]]
606+
===== Privileges
607+
608+
The user accessing this endpoint requires `All` Kibana privileges for the {beat_kib_app} feature.
609+
For more information, see <<kibana-privileges>>.
610+
611+
[[apm-sourcemap-post-req]]
612+
===== Request
613+
614+
`POST /api/apm/sourcemaps`
615+
616+
[role="child_attributes"]
617+
[[apm-sourcemap-post-req-body]]
618+
===== Request body
619+
620+
`service_name`::
621+
(required, string) The name of the service that the service map should apply to.
622+
623+
`service_version`::
624+
(required, string) The version of the service that the service map should apply to.
625+
626+
`bundle_filepath`::
627+
(required, string) The absolute path of the final bundle as used in the web application.
628+
629+
`sourcemap`::
630+
(required, string or file upload) The source map. It must follow the
631+
https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k[source map revision 3 proposal].
632+
633+
[[apm-sourcemap-post-example]]
634+
===== Examples
635+
636+
The following example uploads a source map for a service named `foo` and a service version of `1.0.0`:
637+
638+
[source,curl]
639+
--------------------------------------------------
640+
curl -X POST "http://localhost:5601/api/apm/sourcemaps" \
641+
-H 'Content-Type: multipart/form-data' \
642+
-H 'kbn-xsrf: true' \
643+
-H 'Authorization: ApiKey ${YOUR_API_KEY}' \
644+
-F 'service_name="foo"' \
645+
-F 'service_version="1.0.0"' \
646+
-F 'bundle_filepath="/test/e2e/general-usecase/bundle.js.map"' \
647+
-F 'sourcemap="{\"version\":3,\"file\":\"static/js/main.chunk.js\",\"sources\":[\"fleet-source-map-client/src/index.css\",\"fleet-source-map-client/src/App.js\",\"webpack:///./src/index.css?bb0a\",\"fleet-source-map-client/src/index.js\",\"fleet-source-map-client/src/reportWebVitals.js\"],\"sourcesContent\":[\"content\"],\"mappings\":\"mapping\",\"sourceRoot\":\"\"}"' <1>
648+
--------------------------------------------------
649+
<1> Alternatively, upload the source map as a file with `-F 'sourcemap=@path/to/source_map/bundle.js.map'`
650+
651+
[[apm-sourcemap-post-body]]
652+
===== Response body
653+
654+
[source,js]
655+
--------------------------------------------------
656+
{
657+
"type": "sourcemap",
658+
"identifier": "foo-1.0.0",
659+
"relative_url": "/api/fleet/artifacts/foo-1.0.0/644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
660+
"body": "eJyFkL1OwzAUhd/Fc+MbYMuCEBIbHRjKgBgc96R16tiWr1OQqr47NwqJxEK3q/PzWccXxchnZ7E1A1SjuhjVZtF2yOxiEPlO17oWox3D3uPFeSRTjmJQARfCPeiAgGx8NTKsYdAc1T3rwaSJGcds8Sp3c1HnhfywUZ3QhMTFFGepZxqMC9oex3CS9tpk1XyozgOlmoVKuJX1DqEQZ0su7PGtLU+V/3JPKc3cL7TJ2FNDRPov4bFta3MDM4f7W69lpJjLO9qdK8bzVPhcJz3HUCQ4LbO/p5hCSC4cZPByrp/wFqOklbpefwAhzpqI",
661+
"created": "2021-07-09T20:47:44.812Z",
662+
"id": "apm:foo-1.0.0-644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
663+
"compressionAlgorithm": "zlib",
664+
"decodedSha256": "644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
665+
"decodedSize": 441,
666+
"encodedSha256": "024c72749c3e3dd411b103f7040ae62633558608f480bce4b108cf5b2275bd24",
667+
"encodedSize": 237,
668+
"encryptionAlgorithm": "none",
669+
"packageName": "apm"
670+
}
671+
--------------------------------------------------
672+
673+
////
674+
*******************************************************
675+
////
676+
677+
[[rum-sourcemap-get]]
678+
==== Get source maps
679+
680+
Returns an array of Fleet artifacts, including source map uploads.
681+
682+
[[rum-sourcemap-get-privs]]
683+
===== Privileges
684+
685+
The user accessing this endpoint requires `Read` or `All` Kibana privileges for the {beat_kib_app} feature.
686+
For more information, see <<kibana-privileges>>.
687+
688+
[[apm-sourcemap-get-req]]
689+
===== Request
690+
691+
`GET /api/apm/sourcemaps`
692+
693+
[[apm-sourcemap-get-example]]
694+
===== Example
695+
696+
The following example requests all uploaded source maps:
697+
698+
[source,curl]
699+
--------------------------------------------------
700+
curl -X GET "http://localhost:5601/api/apm/sourcemaps" \
701+
-H 'Content-Type: application/json' \
702+
-H 'kbn-xsrf: true' \
703+
-H 'Authorization: ApiKey ${YOUR_API_KEY}'
704+
--------------------------------------------------
705+
706+
[[apm-sourcemap-get-body]]
707+
===== Response body
708+
709+
[source,js]
710+
--------------------------------------------------
711+
{
712+
"artifacts": [
713+
{
714+
"type": "sourcemap",
715+
"identifier": "foo-1.0.0",
716+
"relative_url": "/api/fleet/artifacts/foo-1.0.0/644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
717+
"body": {
718+
"serviceName": "foo",
719+
"serviceVersion": "1.0.0",
720+
"bundleFilepath": "/test/e2e/general-usecase/bundle.js.map",
721+
"sourceMap": {
722+
"version": 3,
723+
"file": "static/js/main.chunk.js",
724+
"sources": [
725+
"fleet-source-map-client/src/index.css",
726+
"fleet-source-map-client/src/App.js",
727+
"webpack:///./src/index.css?bb0a",
728+
"fleet-source-map-client/src/index.js",
729+
"fleet-source-map-client/src/reportWebVitals.js"
730+
],
731+
"sourcesContent": [
732+
"content"
733+
],
734+
"mappings": "mapping",
735+
"sourceRoot": ""
736+
}
737+
},
738+
"created": "2021-07-09T20:47:44.812Z",
739+
"id": "apm:foo-1.0.0-644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
740+
"compressionAlgorithm": "zlib",
741+
"decodedSha256": "644fd5a997d1ddd90ee131ba18e2b3d03931d89dd1fe4599143c0b3264b3e456",
742+
"decodedSize": 441,
743+
"encodedSha256": "024c72749c3e3dd411b103f7040ae62633558608f480bce4b108cf5b2275bd24",
744+
"encodedSize": 237,
745+
"encryptionAlgorithm": "none",
746+
"packageName": "apm"
747+
}
748+
]
749+
}
750+
--------------------------------------------------
751+
752+
////
753+
*******************************************************
754+
////
755+
756+
[[rum-sourcemap-delete]]
757+
==== Delete source map
758+
759+
Delete a previously uploaded source map.
760+
761+
[[rum-sourcemap-delete-privs]]
762+
===== Privileges
763+
764+
The user accessing this endpoint requires `All` Kibana privileges for the {beat_kib_app} feature.
765+
For more information, see <<kibana-privileges>>.
766+
767+
[[apm-sourcemap-delete-req]]
768+
===== Request
769+
770+
`DELETE /api/apm/sourcemaps/:id`
771+
772+
[[apm-sourcemap-delete-example]]
773+
===== Example
774+
775+
The following example deletes a source map with an id of `apm:foo-1.0.0-644fd5a9`:
776+
777+
[source,curl]
778+
--------------------------------------------------
779+
curl -X DELETE "http://localhost:5601/api/apm/sourcemaps/apm:foo-1.0.0-644fd5a9" \
780+
-H 'Content-Type: application/json' \
781+
-H 'kbn-xsrf: true' \
782+
-H 'Authorization: ApiKey ${YOUR_API_KEY}'
783+
--------------------------------------------------
784+
785+
[[apm-sourcemap-delete-body]]
786+
===== Response body
787+
788+
[source,js]
789+
--------------------------------------------------
790+
{}
791+
--------------------------------------------------

0 commit comments

Comments
 (0)