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

VRL web playground timezone option / menu configuration #20609

Open
DimDroll opened this issue Jun 4, 2024 · 1 comment
Open

VRL web playground timezone option / menu configuration #20609

DimDroll opened this issue Jun 4, 2024 · 1 comment
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: playground Changes to the VRL Web Playground.

Comments

@DimDroll
Copy link

DimDroll commented Jun 4, 2024

Hello Vector Team,

Thank you for great web playground that you host free of charge here:
https://playground.vrl.dev/

I'm located in non-UTC aligned country and when I test timestamp transformation with timezone I get this:

{
	"foo": "delete me",
	"http_status": "200",
	"message": "Hello VRL",
	"vector_timezone": "Europe/Kiev"
}

from:

.vector_timezone = get_timezone_name!()

For some edge cases where I need to test different timezone like the one I run on my servers (UTC) there is no easy way to do it.

Currently I found a place to modify it for my local playground run in:

let timezone = TimeZone::default();

vector❯ git diff lib/vector-vrl/web-playground/src/lib.rs
diff --git a/lib/vector-vrl/web-playground/src/lib.rs b/lib/vector-vrl/web-playground/src/lib.rs
index a434050ae..97b084aaa 100644
--- a/lib/vector-vrl/web-playground/src/lib.rs
+++ b/lib/vector-vrl/web-playground/src/lib.rs
@@ -85,8 +85,8 @@ fn compile(mut input: Input) -> Result<VrlCompileResult, VrlDiagnosticResult> {
     let state = TypeState::default();
     let mut runtime = Runtime::default();
     let config = CompileConfig::default();
-    let timezone = TimeZone::default();
-
+//    let timezone = TimeZone::default();
+    let timezone = TimeZone::parse("UTC").expect("Failed to parse timezone");
     let mut target_value = TargetValue {
         value: event.clone(),
         metadata: Value::Object(BTreeMap::new()),

I would like to suggest a feature to have UI switch / configuration option where I could choose from a dropdown either use my local timezone by default or switch to UTC (as this is the most common timezone wordwide for servers).

Thank you!

p.s. timezone can be set in vector configuration globally, but for playground unfortunately, in remap specifically there is no way to set it. maybe as more solid approach playground could support vector configuration file to be uploaded and used to customize settings that are not available in remap.

@jszwedko jszwedko added vrl: playground Changes to the VRL Web Playground. type: feature A value-adding code addition that introduce new functionality. labels Jun 4, 2024
@jszwedko
Copy link
Member

jszwedko commented Jun 4, 2024

Good idea! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature A value-adding code addition that introduce new functionality. vrl: playground Changes to the VRL Web Playground.
Projects
None yet
Development

No branches or pull requests

2 participants